badger_cache

package
v0.0.0-...-fdc8e6b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2022 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Minimum Duration between full bucket scans looking for expired keys
	COMPACTION_SCAN_INTERVAL = 15 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerCache

func NewBadgerCache

func NewBadgerCache(cfg *BadgerCacheConfig) (*BadgerCache, error)

func (*BadgerCache) Close

func (bc *BadgerCache) Close()

func (*BadgerCache) ExpiryScan

func (bc *BadgerCache) ExpiryScan()

Ran on interval by the StoreExpiry

func (*BadgerCache) Insert

func (bc *BadgerCache) Insert(key string, value []byte) error

func (*BadgerCache) InsertTTL

func (bc *BadgerCache) InsertTTL(key string, value []byte, ttl time.Duration) error

func (*BadgerCache) Name

func (bc *BadgerCache) Name() string

func (*BadgerCache) Remove

func (bc *BadgerCache) Remove(key string) error

func (*BadgerCache) Retrieve

func (bc *BadgerCache) Retrieve(key string) ([]byte, error)

func (*BadgerCache) Start

func (bc *BadgerCache) Start()

func (*BadgerCache) Stop

func (bc *BadgerCache) Stop()

func (*BadgerCache) TTL

func (bc *BadgerCache) TTL(key string) (time.Duration, error)

TTL returns an error if the key does not exist, or it has no expiry Otherwise return a TTL (always at least 1 Second per `StoreExpiry`)

type BadgerCacheConfig

type BadgerCacheConfig struct {
	cache.CacheConfig
	// contains filtered or unexported fields
}

func NewBadgerCacheConfig

func NewBadgerCacheConfig(cacheConfig cache.CacheConfig, path string) *BadgerCacheConfig

func (*BadgerCacheConfig) RegisterFlags

func (c *BadgerCacheConfig) RegisterFlags(f *flag.FlagSet, cacheID string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL