Versions in this module Expand all Collapse all v1 v1.8.1 Jun 20, 2018 Changes in this version + var ErrCacheMiss = errors.New("cache: miss") + var ErrNotStored = errors.New("cache: not stored") + var Null = &nullCache + func Add(ctx context.Context, key string, value interface{}, expire time.Duration) error + func Dec(ctx context.Context, key string, value uint64) (int64, error) + func Delete(ctx context.Context, key string) error + func Inc(ctx context.Context, key string, value uint64) (int64, error) + func Replace(ctx context.Context, key string, value interface{}, expire time.Duration) error + func Set(ctx context.Context, key string, value interface{}, expire time.Duration) error + func WithCache(ctx context.Context, cache Cache) context.Context + type Cache interface + Add func(key string, value interface{}, expire time.Duration) error + Dec func(key string, value uint64) (int64, error) + Delete func(key string) error + Get func(key string) *Item + GetMulti func(keys ...string) ([]*Item, error) + Inc func(key string, value uint64) (int64, error) + Replace func(key string, value interface{}, expire time.Duration) error + Set func(key string, value interface{}, expire time.Duration) error + func FromContext(ctx context.Context) (Cache, bool) + func NewMemcache(uri string, opts ...MemcacheOptionsFunc) Cache + func NewRedis(uri string, opts ...RedisOptionsFunc) (Cache, error) + type Item struct + func Get(ctx context.Context, key string) *Item + func GetMulti(ctx context.Context, keys ...string) ([]*Item, error) + func (i Item) Bool() (bool, error) + func (i Item) Bytes() ([]byte, error) + func (i Item) Err() error + func (i Item) Float64() (float64, error) + func (i Item) Int64() (int64, error) + func (i Item) String() (string, error) + func (i Item) Uint64() (uint64, error) + type MemcacheOptionsFunc func(*memcache.Client) + func WithIdleConns(size int) MemcacheOptionsFunc + func WithTimeout(timeout time.Duration) MemcacheOptionsFunc + type RedisOptionsFunc func(*redis.Options) + func WithPoolSize(size int) RedisOptionsFunc + func WithPoolTimeout(timeout time.Duration) RedisOptionsFunc + func WithReadTimeout(timeout time.Duration) RedisOptionsFunc + func WithWriteTimeout(timeout time.Duration) RedisOptionsFunc Incompatible versions in this module v2.5.0+incompatible Oct 19, 2018 v2.4.0+incompatible Oct 2, 2018 Other modules containing this package github.com/msales/pkg/v3 github.com/msales/pkg/v4