Documentation ¶
Index ¶
- func DefaultKeyTransform(key string) string
- func NewCache(redisClient *redis.Client, options ...CacheOption) yacache.Cache
- func WithLFA() func(cache *Cache) error
- func WithLRU() func(cache *Cache) error
- func WithMaxSize(size int64) func(cache *Cache) error
- func WithPrefix(prefix string) func(cache *Cache) error
- type Cache
- func (c *Cache) Contains(ctx context.Context, key yacache.Key) (bool, error)
- func (c *Cache) Delete(ctx context.Context, key yacache.Key) error
- func (c *Cache) Get(ctx context.Context, key yacache.Key, fetcher yacache.Fetcher) (yacache.Item, error)
- func (c *Cache) Put(ctx context.Context, key yacache.Key, fetcher yacache.Fetcher) error
- type CacheOption
- type KeyTransform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultKeyTransform ¶
func NewCache ¶
func NewCache(redisClient *redis.Client, options ...CacheOption) yacache.Cache
NewCache returns a new yacache.Cache that is backed by Redis.
func WithMaxSize ¶
func WithPrefix ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
type CacheOption ¶
type KeyTransform ¶
Click to show internal directories.
Click to hide internal directories.