lru_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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LruCache

func NewLruCache

func NewLruCache(cfg *LruCacheConfig) (*LruCache, error)

func (*LruCache) Close

func (lc *LruCache) Close()

func (*LruCache) InsertTTL

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

func (*LruCache) Len

func (lc *LruCache) Len() uint

Both MemoryExpiry and LruStore have Len methods - we need to specify which here

func (*LruCache) Name

func (lc *LruCache) Name() string

func (*LruCache) Start

func (lc *LruCache) Start()

func (*LruCache) Stop

func (lc *LruCache) Stop()

func (*LruCache) TTL

func (lc *LruCache) 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 `MemoryExpiry`)

type LruCacheConfig

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

func NewLruCacheConfig

func NewLruCacheConfig(size int, cacheCfg cache.CacheConfig) *LruCacheConfig

Jump to

Keyboard shortcuts

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