Versions in this module Expand all Collapse all v0 v0.1.0 Sep 22, 2020 Changes in this version + var DefaultEncoding = GobEncoding + var ErrCacheMiss = errors.New("cache miss") + var ErrNotANumber = errors.New("value currently stored is not a number") + var ErrNotAPointer = errors.New("argument to Get() must be a pointer") + var ErrNotStored = errors.New("not stored") + var NeverExpire time.Time + func NewGobEncoding() *gobEncoding + func NewJsonEncoding() *jsonEncoding + func NewLiteralEncoding(fallback Encoding) *literalEncoding + func NewMemcacheClient(c *memcache.Client, encoding Encoding) *memcacheClient + func NewRedisClient(c *redis.Client, encoding Encoding) *redisClient + func TtlForExpiration(t time.Time) time.Duration + type Client interface + Add func(key string, data interface{}, expiration time.Time) error + Decrement func(key string, delta uint64) (uint64, error) + Delete func(key string) error + Get func(key string, data interface{}) error + Increment func(key string, delta uint64) (uint64, error) + Set func(key string, data interface{}, expiration time.Time) error + func NewMemoryClient() Client + type Decoder interface + Decode func(b []byte, data interface{}) error + type Encoder interface + Encode func(data interface{}) ([]byte, error) + type Encoding interface + var GobEncoding Encoding = NewGobEncoding() + var JsonEncoding Encoding = NewJsonEncoding()