Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCacheMiss = errors.New("cache: key is missing")
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache provides strongly types methods to store and retrieve values from shared cache
func NewCache ¶
func NewCache(client CacheClient) *Cache
type CacheClient ¶
type CacheClient interface { Set(item *Item) error Get(key string, obj interface{}) error Delete(key string) error }
func NewRedisCache ¶
func NewRedisCache(client *redis.Client, expiration time.Duration) CacheClient
type InMemoryCache ¶
type InMemoryCache struct {
// contains filtered or unexported fields
}
func NewInMemoryCache ¶
func NewInMemoryCache(expiration time.Duration) *InMemoryCache
func (*InMemoryCache) Delete ¶
func (i *InMemoryCache) Delete(key string) error
func (*InMemoryCache) Flush ¶
func (i *InMemoryCache) Flush()
func (*InMemoryCache) Get ¶
func (i *InMemoryCache) Get(key string, obj interface{}) error
func (*InMemoryCache) Set ¶
func (i *InMemoryCache) Set(item *Item) error
Click to show internal directories.
Click to hide internal directories.