bolt_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: 11 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
	// Max number of keys to scan in a single DB Transaction
	COMPACTION_MAX_SCAN = 5000
)

Variables

View Source
var ErrCompactionFinished = errors.New("compaction has finished")
View Source
var ErrCompactionInterupted = errors.New("compaction was interupted")

Functions

This section is empty.

Types

type BoltCache

func NewBoltCache

func NewBoltCache(cfg *BoltCacheConfig) (*BoltCache, error)

func (*BoltCache) Close

func (bc *BoltCache) Close()

func (*BoltCache) ExpiryScan

func (bc *BoltCache) ExpiryScan()

Ran on interval by the StoreExpiry

func (*BoltCache) Insert

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

func (*BoltCache) InsertBatch

func (bc *BoltCache) InsertBatch(key string, value []byte) error

func (*BoltCache) InsertTTL

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

func (*BoltCache) Name

func (bc *BoltCache) Name() string

func (*BoltCache) Remove

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

func (*BoltCache) Retrieve

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

func (*BoltCache) Start

func (bc *BoltCache) Start()

func (*BoltCache) Stop

func (bc *BoltCache) Stop()

func (*BoltCache) TTL

func (bc *BoltCache) 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 BoltCacheConfig

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

func NewBoltCacheConfig

func NewBoltCacheConfig(cacheConfig cache.CacheConfig, path string, bucketName string) *BoltCacheConfig

func (*BoltCacheConfig) RegisterFlags

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

Jump to

Keyboard shortcuts

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