redis

package
v0.0.0-...-3533b87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultKeyTransform

func DefaultKeyTransform(key string) string

func NewCache

func NewCache(redisClient *redis.Client, options ...CacheOption) yacache.Cache

NewCache returns a new yacache.Cache that is backed by Redis.

func WithLFA

func WithLFA() func(cache *Cache) error

func WithLRU

func WithLRU() func(cache *Cache) error

func WithMaxSize

func WithMaxSize(size int64) func(cache *Cache) error

func WithPrefix

func WithPrefix(prefix string) func(cache *Cache) error

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func (*Cache) Contains

func (c *Cache) Contains(ctx context.Context, key yacache.Key) (bool, error)

func (*Cache) Delete

func (c *Cache) Delete(ctx context.Context, key yacache.Key) error

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, key yacache.Key, fetcher yacache.Fetcher) (yacache.Item, error)

func (*Cache) Put

func (c *Cache) Put(ctx context.Context, key yacache.Key, fetcher yacache.Fetcher) error

type CacheOption

type CacheOption func(cache *Cache) error

type KeyTransform

type KeyTransform func(string) string

Jump to

Keyboard shortcuts

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