Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { MaxSizeToCache int Config *config.CacheConfig // contains filtered or unexported fields }
Cache defines operations for a cache service.
type Cacheable ¶
type Cacheable interface { // CacheKey returns a cache key string to manage cached entries. CacheKey() string // DecodeBytes deserializes the byte slice given by by. // It can assume ownership and destroy the content of by. DecodeBytes(by []byte) error // EncodeBytes returns a serialized byte slice of the object. EncodeBytes() ([]byte, error) }
Cacheable is an interface that objects implement to support caching.
type Driver ¶
type Driver interface { Set(ctx context.Context, key string, value []byte, expiration time.Duration) error Get(ctx context.Context, key string) ([]byte, error) Delete(ctx context.Context, key string) error ListKeys(ctx context.Context) ([]string, error) FlushAll(ctx context.Context) error }
Driver interface defines common operations for the cache store.
Click to show internal directories.
Click to hide internal directories.