Documentation ¶
Index ¶
Constants ¶
View Source
const ( Memcache = "memcache" Redis = "redis" Memory = "memory" Lru = "lru" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CacheInterface ¶
type CacheInterface interface { Has(key string) bool Get(key string, dst ...interface{}) ([]byte, error) Set(key string, val interface{}, ttl time.Duration) (err error) Del(key string) error }
func New ¶
func New(uri string) (CacheInterface, error)
func NewLruCache ¶
func NewLruCache(size int) (CacheInterface, error)
func NewMemcacheCache ¶
func NewMemcacheCache(s MemcacheSettings) (CacheInterface, error)
func NewMemoryCache ¶
func NewMemoryCache(cleanupTime time.Duration) (CacheInterface, error)
func NewRedisCache ¶
func NewRedisCache(c RedisSettings) (CacheInterface, error)
type LruCache ¶
type LruCache struct {
// contains filtered or unexported fields
}
type MemcacheCache ¶
type MemcacheCache struct {
// contains filtered or unexported fields
}
func (*MemcacheCache) Del ¶
func (mc *MemcacheCache) Del(key string) error
func (*MemcacheCache) Get ¶
func (mc *MemcacheCache) Get(key string, dst ...interface{}) ([]byte, error)
func (*MemcacheCache) Has ¶
func (mc *MemcacheCache) Has(key string) bool
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func (*MemoryCache) Del ¶
func (mc *MemoryCache) Del(key string) error
func (*MemoryCache) Get ¶
func (mc *MemoryCache) Get(key string, dst ...interface{}) ([]byte, error)
func (*MemoryCache) Has ¶
func (mc *MemoryCache) Has(key string) bool
type RedisCache ¶
type RedisCache struct { CacheInterface // contains filtered or unexported fields }
func (*RedisCache) Del ¶
func (rc *RedisCache) Del(key string) error
func (*RedisCache) Get ¶
func (rc *RedisCache) Get(key string, dst ...interface{}) ([]byte, error)
func (*RedisCache) Has ¶
func (rc *RedisCache) Has(key string) bool
Click to show internal directories.
Click to hide internal directories.