Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Get(key string, value interface{}) (ok bool) GetBytes(key string) (value []byte, ok bool) Set(key string, value interface{}) error SetWithExpiry(key string, value interface{}, duration time.Duration) error Delete(k string) error Reset() error Exists(key string) (ok bool) KeysByPrefix(prefix string) ([]string, error) Iterate(it func(key string, val interface{})) error Close(ctx context.Context) error }
func MustDiscard ¶
func MustDiscard() Cache
MustDiscard opens a discard-cache that can be used as fallback for openCache-related errors
type Config ¶
type Config struct { // Cache identifier, should be always set Prefix string // Eviction is a golang duration expressed as string ("10s", "1m", etc...). Using -1 means no expiration Eviction string // CleanWindow may be used by caches to trigger expired keys cleaning CleanWindow string // DiscardFallback switches to a "no-op" cache if the cache opening fails DiscardFallback bool }
Config holds cache configurations
Click to show internal directories.
Click to hide internal directories.