Documentation ¶
Index ¶
- Constants
- func Register(name string, store Store)
- func Version() string
- type AdapterConfig
- type Cache
- func (this *Cache) Client() interface{}
- func (this *Cache) Decr(key string) (int64, error)
- func (this *Cache) Del(keys ...string) (int64, error)
- func (this *Cache) Delete(key string) error
- func (this *Cache) DeleteByPrefix(prefix string) error
- func (this *Cache) Exist(key string) bool
- func (this *Cache) Exists(keys ...string) (int64, error)
- func (this *Cache) Expire(key string, expiration time.Duration) (bool, error)
- func (this *Cache) Flush() error
- func (this *Cache) Get(key string) (string, error)
- func (this *Cache) HDel(key string, fields ...string) (int64, error)
- func (this *Cache) HExists(key, field string) (bool, error)
- func (this *Cache) HGet(key, field string) (string, error)
- func (this *Cache) HGetAll(key string) (map[string]string, error)
- func (this *Cache) HMGet(key string, fields ...string) ([]interface{}, error)
- func (this *Cache) HMSet(key string, values ...interface{}) (bool, error)
- func (this *Cache) HSet(key string, values ...interface{}) (int64, error)
- func (this *Cache) HSetNX(key, field string, value interface{}) (bool, error)
- func (this *Cache) Incr(key string) (int64, error)
- func (this *Cache) Key(key string) string
- func (this *Cache) LLen(key string) (int64, error)
- func (this *Cache) LPush(key string, values ...interface{}) (int64, error)
- func (this *Cache) LRange(key string, start, stop int64) ([]string, error)
- func (this *Cache) SAdd(key string, members ...interface{}) (int64, error)
- func (this *Cache) SCard(key string) (int64, error)
- func (this *Cache) SRem(key string, members ...interface{}) (int64, error)
- func (this *Cache) SScan(key string, cursor uint64, match string, count int64) ([]string, uint64, error)
- func (this *Cache) Set(key, val string, expiration time.Duration) error
- func (this *Cache) SetEX(key string, value interface{}, expiration time.Duration) (string, error)
- func (this *Cache) SetNX(key string, value interface{}, expiration time.Duration) (bool, error)
- func (this *Cache) TTL(key string) (time.Duration, error)
- func (this *Cache) Touch(key string) error
- func (this *Cache) Type(key string) (string, error)
- func (this *Cache) ZAdd(key string, members ...*redis.Z) (int64, error)
- func (this *Cache) ZRange(key string, start, stop int64) ([]string, error)
- func (this *Cache) ZRank(key, member string) (int64, error)
- func (this *Cache) ZRem(key string, members ...interface{}) (int64, error)
- func (this *Cache) ZScore(key, member string) (float64, error)
- type MemoryCache
- func (c *MemoryCache) BitCount(key string, bitCount *redis.BitCount) (int64, error)
- func (c *MemoryCache) BitField(key string, args ...interface{}) ([]int64, error)
- func (c *MemoryCache) BitOpAnd(destKey string, keys ...string) (int64, error)
- func (c *MemoryCache) BitOpNot(destKey string, key string) (int64, error)
- func (c *MemoryCache) BitOpOr(destKey string, keys ...string) (int64, error)
- func (c *MemoryCache) BitOpXor(destKey string, keys ...string) (int64, error)
- func (c *MemoryCache) BitPos(key string, bit int64, pos ...int64) (int64, error)
- func (r *MemoryCache) Client() interface{}
- func (c *MemoryCache) Decr(key string) (int64, error)
- func (c *MemoryCache) Del(keys ...string) (int64, error)
- func (c *MemoryCache) Delete(key string) error
- func (c *MemoryCache) DeleteByPrefix(prefix string) error
- func (c *MemoryCache) Exist(key string) bool
- func (c *MemoryCache) Exists(keys ...string) (int64, error)
- func (c *MemoryCache) Expire(key string, expiration time.Duration) (bool, error)
- func (c *MemoryCache) Flush() error
- func (c *MemoryCache) Forever(key, val string) error
- func (c *MemoryCache) Get(key string) (string, error)
- func (c *MemoryCache) GetBit(key string, offset int64) (int64, error)
- func (c *MemoryCache) HDel(key string, fields ...string) (int64, error)
- func (c *MemoryCache) HExists(key, field string) (bool, error)
- func (c *MemoryCache) HGet(key, field string) (string, error)
- func (c *MemoryCache) HGetAll(key string) (map[string]string, error)
- func (c *MemoryCache) HMGet(key string, fields ...string) ([]interface{}, error)
- func (c *MemoryCache) HMSet(key string, values ...interface{}) (bool, error)
- func (c *MemoryCache) HSet(key string, values ...interface{}) (int64, error)
- func (c *MemoryCache) HSetNX(key, field string, value interface{}) (bool, error)
- func (c *MemoryCache) Incr(key string) (int64, error)
- func (r *MemoryCache) Key(key string) string
- func (c *MemoryCache) LLen(key string) (int64, error)
- func (c *MemoryCache) LPush(key string, values ...interface{}) (int64, error)
- func (c *MemoryCache) LRange(key string, start, stop int64) ([]string, error)
- func (c *MemoryCache) RPop(key string) (string, error)
- func (c *MemoryCache) RPopCount(key string, count int) ([]string, error)
- func (c *MemoryCache) RPopLPush(source, destination string) (string, error)
- func (c *MemoryCache) RPush(key string, values ...interface{}) (int64, error)
- func (c *MemoryCache) RPushX(key string, values ...interface{}) (int64, error)
- func (c *MemoryCache) RunScript(src string, keys []string, args ...interface{}) (interface{}, error)
- func (c *MemoryCache) SAdd(key string, members ...interface{}) (int64, error)
- func (c *MemoryCache) SCard(key string) (int64, error)
- func (c *MemoryCache) SRem(key string, members ...interface{}) (int64, error)
- func (c *MemoryCache) SScan(key string, cursor uint64, match string, count int64) ([]string, uint64, error)
- func (c *MemoryCache) Set(key, val string, expiration time.Duration) error
- func (c *MemoryCache) SetBit(key string, offset int64, value int) (int64, error)
- func (c *MemoryCache) SetEX(key string, value interface{}, expiration time.Duration) (string, error)
- func (c *MemoryCache) SetNX(key string, value interface{}, expiration time.Duration) (bool, error)
- func (c *MemoryCache) TTL(key string) (time.Duration, error)
- func (c *MemoryCache) Touch(key string) error
- func (c *MemoryCache) Type(key string) (string, error)
- func (c *MemoryCache) ZAdd(key string, members ...*redis.Z) (int64, error)
- func (c *MemoryCache) ZRange(key string, start, stop int64) ([]string, error)
- func (c *MemoryCache) ZRank(key, member string) (int64, error)
- func (c *MemoryCache) ZRem(key string, members ...interface{}) (int64, error)
- func (c *MemoryCache) ZScore(key, member string) (float64, error)
- type MemoryItem
- type Options
- type RedisCache
- func (r *RedisCache) BitCount(key string, bitCount *redis.BitCount) (int64, error)
- func (r *RedisCache) BitField(key string, args ...interface{}) ([]int64, error)
- func (r *RedisCache) BitOpAnd(destKey string, keys ...string) (int64, error)
- func (r *RedisCache) BitOpNot(destKey string, key string) (int64, error)
- func (r *RedisCache) BitOpOr(destKey string, keys ...string) (int64, error)
- func (r *RedisCache) BitOpXor(destKey string, keys ...string) (int64, error)
- func (r *RedisCache) BitPos(key string, bit int64, pos ...int64) (int64, error)
- func (r *RedisCache) Client() interface{}
- func (r *RedisCache) Decr(key string) (int64, error)
- func (r *RedisCache) Del(keys ...string) (int64, error)
- func (r *RedisCache) Delete(key string) error
- func (r *RedisCache) DeleteByPrefix(prefix string) error
- func (r *RedisCache) Exist(key string) bool
- func (r *RedisCache) Exists(keys ...string) (int64, error)
- func (r *RedisCache) Expire(key string, expiration time.Duration) (bool, error)
- func (r *RedisCache) Flush() error
- func (r *RedisCache) Get(key string) (string, error)
- func (r *RedisCache) GetBit(key string, offset int64) (int64, error)
- func (r *RedisCache) HDel(key string, fields ...string) (int64, error)
- func (r *RedisCache) HExists(key, field string) (bool, error)
- func (r *RedisCache) HGet(key, field string) (string, error)
- func (r *RedisCache) HGetAll(key string) (map[string]string, error)
- func (r *RedisCache) HMGet(key string, fields ...string) ([]interface{}, error)
- func (r *RedisCache) HMSet(key string, values ...interface{}) (bool, error)
- func (r *RedisCache) HSet(key string, values ...interface{}) (int64, error)
- func (r *RedisCache) HSetNX(key, field string, value interface{}) (bool, error)
- func (r *RedisCache) Incr(key string) (int64, error)
- func (r *RedisCache) Key(key string) string
- func (r *RedisCache) LLen(key string) (int64, error)
- func (r *RedisCache) LPush(key string, values ...interface{}) (int64, error)
- func (r *RedisCache) LRange(key string, start, stop int64) ([]string, error)
- func (r *RedisCache) RPop(key string) (string, error)
- func (r *RedisCache) RPopCount(key string, count int) ([]string, error)
- func (r *RedisCache) RPopLPush(source, destination string) (string, error)
- func (r *RedisCache) RPush(key string, values ...interface{}) (int64, error)
- func (r *RedisCache) RPushX(key string, values ...interface{}) (int64, error)
- func (r *RedisCache) RunScript(src string, keys []string, args ...interface{}) (interface{}, error)
- func (r *RedisCache) SAdd(key string, members ...interface{}) (int64, error)
- func (r *RedisCache) SCard(key string) (int64, error)
- func (r *RedisCache) SRem(key string, members ...interface{}) (int64, error)
- func (r *RedisCache) SScan(key string, cursor uint64, match string, count int64) (keys []string, cursorOut uint64, err error)
- func (r *RedisCache) Set(key, val string, expiration time.Duration) error
- func (r *RedisCache) SetBit(key string, offset int64, value int) (int64, error)
- func (r *RedisCache) SetEX(key string, value interface{}, expiration time.Duration) (string, error)
- func (r *RedisCache) SetNX(key string, value interface{}, expiration time.Duration) (bool, error)
- func (r *RedisCache) TTL(key string) (time.Duration, error)
- func (r *RedisCache) Touch(key string) error
- func (r *RedisCache) Type(key string) (string, error)
- func (r *RedisCache) ZAdd(key string, members ...*redis.Z) (int64, error)
- func (r *RedisCache) ZRange(key string, start, stop int64) ([]string, error)
- func (r *RedisCache) ZRank(key, member string) (int64, error)
- func (r *RedisCache) ZRem(key string, members ...interface{}) (int64, error)
- func (r *RedisCache) ZScore(key, member string) (float64, error)
- type Store
Constants ¶
View Source
const VersionName = "0.1.0"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdapterConfig ¶
type Cache ¶
type Cache struct { Opt Options // contains filtered or unexported fields }
func (*Cache) DeleteByPrefix ¶
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
MemoryCache represents a memory cache adapter implementation.
func NewMemoryCache ¶
func NewMemoryCache() *MemoryCache
NewMemoryCache creates and returns a new memory cache.
func (*MemoryCache) BitCount ¶ added in v1.0.7
func (c *MemoryCache) BitCount(key string, bitCount *redis.BitCount) (int64, error)
func (*MemoryCache) BitField ¶ added in v1.0.7
func (c *MemoryCache) BitField(key string, args ...interface{}) ([]int64, error)
func (*MemoryCache) BitOpAnd ¶ added in v1.0.7
func (c *MemoryCache) BitOpAnd(destKey string, keys ...string) (int64, error)
func (*MemoryCache) BitOpNot ¶ added in v1.0.7
func (c *MemoryCache) BitOpNot(destKey string, key string) (int64, error)
func (*MemoryCache) BitOpOr ¶ added in v1.0.7
func (c *MemoryCache) BitOpOr(destKey string, keys ...string) (int64, error)
func (*MemoryCache) BitOpXor ¶ added in v1.0.7
func (c *MemoryCache) BitOpXor(destKey string, keys ...string) (int64, error)
func (*MemoryCache) Client ¶ added in v0.5.0
func (r *MemoryCache) Client() interface{}
func (*MemoryCache) Delete ¶
func (c *MemoryCache) Delete(key string) error
func (*MemoryCache) DeleteByPrefix ¶
func (c *MemoryCache) DeleteByPrefix(prefix string) error
func (*MemoryCache) Exist ¶ added in v1.0.6
func (c *MemoryCache) Exist(key string) bool
func (*MemoryCache) Exists ¶ added in v1.0.5
func (c *MemoryCache) Exists(keys ...string) (int64, error)
func (*MemoryCache) Flush ¶
func (c *MemoryCache) Flush() error
func (*MemoryCache) Forever ¶
func (c *MemoryCache) Forever(key, val string) error
Forever put value into cache with key forever save
func (*MemoryCache) GetBit ¶ added in v1.0.7
func (c *MemoryCache) GetBit(key string, offset int64) (int64, error)
func (*MemoryCache) HDel ¶ added in v1.0.5
func (c *MemoryCache) HDel(key string, fields ...string) (int64, error)
func (*MemoryCache) HExists ¶ added in v1.0.5
func (c *MemoryCache) HExists(key, field string) (bool, error)
func (*MemoryCache) HGet ¶ added in v1.0.5
func (c *MemoryCache) HGet(key, field string) (string, error)
func (*MemoryCache) HGetAll ¶ added in v1.0.5
func (c *MemoryCache) HGetAll(key string) (map[string]string, error)
func (*MemoryCache) HMGet ¶ added in v1.0.5
func (c *MemoryCache) HMGet(key string, fields ...string) ([]interface{}, error)
func (*MemoryCache) HMSet ¶ added in v1.0.5
func (c *MemoryCache) HMSet(key string, values ...interface{}) (bool, error)
func (*MemoryCache) HSet ¶ added in v1.0.5
func (c *MemoryCache) HSet(key string, values ...interface{}) (int64, error)
func (*MemoryCache) HSetNX ¶ added in v1.0.5
func (c *MemoryCache) HSetNX(key, field string, value interface{}) (bool, error)
func (*MemoryCache) Key ¶ added in v0.5.2
func (r *MemoryCache) Key(key string) string
func (*MemoryCache) LPush ¶ added in v1.0.5
func (c *MemoryCache) LPush(key string, values ...interface{}) (int64, error)
func (*MemoryCache) LRange ¶ added in v1.0.5
func (c *MemoryCache) LRange(key string, start, stop int64) ([]string, error)
func (*MemoryCache) RPopCount ¶ added in v1.0.7
func (c *MemoryCache) RPopCount(key string, count int) ([]string, error)
func (*MemoryCache) RPopLPush ¶ added in v1.0.7
func (c *MemoryCache) RPopLPush(source, destination string) (string, error)
func (*MemoryCache) RPush ¶ added in v1.0.7
func (c *MemoryCache) RPush(key string, values ...interface{}) (int64, error)
func (*MemoryCache) RPushX ¶ added in v1.0.7
func (c *MemoryCache) RPushX(key string, values ...interface{}) (int64, error)
func (*MemoryCache) RunScript ¶ added in v1.0.7
func (c *MemoryCache) RunScript(src string, keys []string, args ...interface{}) (interface{}, error)
func (*MemoryCache) SAdd ¶ added in v1.0.5
func (c *MemoryCache) SAdd(key string, members ...interface{}) (int64, error)
func (*MemoryCache) SRem ¶ added in v1.0.5
func (c *MemoryCache) SRem(key string, members ...interface{}) (int64, error)
func (*MemoryCache) Set ¶
func (c *MemoryCache) Set(key, val string, expiration time.Duration) error
func (*MemoryCache) TTL ¶ added in v1.0.5
func (c *MemoryCache) TTL(key string) (time.Duration, error)
func (*MemoryCache) Touch ¶
func (c *MemoryCache) Touch(key string) error
func (*MemoryCache) ZAdd ¶ added in v1.0.5
func (c *MemoryCache) ZAdd(key string, members ...*redis.Z) (int64, error)
func (*MemoryCache) ZRange ¶ added in v1.0.5
func (c *MemoryCache) ZRange(key string, start, stop int64) ([]string, error)
func (*MemoryCache) ZRank ¶ added in v1.0.5
func (c *MemoryCache) ZRank(key, member string) (int64, error)
type MemoryItem ¶
type MemoryItem struct {
// contains filtered or unexported fields
}
MemoryItem represents a memory cache item.
type Options ¶
type Options struct { // alias Alias string // Name of adapter. Default is "redis". Adapter string // Adapter configuration, it's corresponding to adapter. AdapterConfig AdapterConfig // key prefix Default is "" Section string }
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶
func NewRedisCache() *RedisCache
NewRedisCache creates and returns a new redis cache.
func (*RedisCache) BitCount ¶ added in v1.0.7
func (r *RedisCache) BitCount(key string, bitCount *redis.BitCount) (int64, error)
func (*RedisCache) BitField ¶ added in v1.0.7
func (r *RedisCache) BitField(key string, args ...interface{}) ([]int64, error)
func (*RedisCache) BitOpAnd ¶ added in v1.0.7
func (r *RedisCache) BitOpAnd(destKey string, keys ...string) (int64, error)
func (*RedisCache) BitOpNot ¶ added in v1.0.7
func (r *RedisCache) BitOpNot(destKey string, key string) (int64, error)
func (*RedisCache) BitOpOr ¶ added in v1.0.7
func (r *RedisCache) BitOpOr(destKey string, keys ...string) (int64, error)
func (*RedisCache) BitOpXor ¶ added in v1.0.7
func (r *RedisCache) BitOpXor(destKey string, keys ...string) (int64, error)
func (*RedisCache) Client ¶ added in v0.5.0
func (r *RedisCache) Client() interface{}
func (*RedisCache) Delete ¶
func (r *RedisCache) Delete(key string) error
func (*RedisCache) DeleteByPrefix ¶
func (r *RedisCache) DeleteByPrefix(prefix string) error
DeleteByPrefix Delete deletes cached value by given prefix key.
func (*RedisCache) Exist ¶ added in v1.0.6
func (r *RedisCache) Exist(key string) bool
func (*RedisCache) Exists ¶ added in v1.0.5
func (r *RedisCache) Exists(keys ...string) (int64, error)
func (*RedisCache) Flush ¶
func (r *RedisCache) Flush() error
func (*RedisCache) GetBit ¶ added in v1.0.7
func (r *RedisCache) GetBit(key string, offset int64) (int64, error)
func (*RedisCache) HDel ¶ added in v1.0.5
func (r *RedisCache) HDel(key string, fields ...string) (int64, error)
func (*RedisCache) HExists ¶ added in v1.0.5
func (r *RedisCache) HExists(key, field string) (bool, error)
func (*RedisCache) HGet ¶ added in v1.0.5
func (r *RedisCache) HGet(key, field string) (string, error)
func (*RedisCache) HGetAll ¶ added in v1.0.5
func (r *RedisCache) HGetAll(key string) (map[string]string, error)
func (*RedisCache) HMGet ¶ added in v1.0.5
func (r *RedisCache) HMGet(key string, fields ...string) ([]interface{}, error)
func (*RedisCache) HMSet ¶ added in v1.0.5
func (r *RedisCache) HMSet(key string, values ...interface{}) (bool, error)
func (*RedisCache) HSet ¶ added in v1.0.5
func (r *RedisCache) HSet(key string, values ...interface{}) (int64, error)
func (*RedisCache) HSetNX ¶ added in v1.0.5
func (r *RedisCache) HSetNX(key, field string, value interface{}) (bool, error)
func (*RedisCache) Key ¶ added in v0.5.2
func (r *RedisCache) Key(key string) string
func (*RedisCache) LPush ¶ added in v1.0.5
func (r *RedisCache) LPush(key string, values ...interface{}) (int64, error)
func (*RedisCache) LRange ¶ added in v1.0.5
func (r *RedisCache) LRange(key string, start, stop int64) ([]string, error)
func (*RedisCache) RPopCount ¶ added in v1.0.7
func (r *RedisCache) RPopCount(key string, count int) ([]string, error)
func (*RedisCache) RPopLPush ¶ added in v1.0.7
func (r *RedisCache) RPopLPush(source, destination string) (string, error)
func (*RedisCache) RPush ¶ added in v1.0.7
func (r *RedisCache) RPush(key string, values ...interface{}) (int64, error)
func (*RedisCache) RPushX ¶ added in v1.0.7
func (r *RedisCache) RPushX(key string, values ...interface{}) (int64, error)
func (*RedisCache) RunScript ¶ added in v1.0.7
func (r *RedisCache) RunScript(src string, keys []string, args ...interface{}) (interface{}, error)
func (*RedisCache) SAdd ¶ added in v1.0.5
func (r *RedisCache) SAdd(key string, members ...interface{}) (int64, error)
func (*RedisCache) SRem ¶ added in v1.0.5
func (r *RedisCache) SRem(key string, members ...interface{}) (int64, error)
func (*RedisCache) TTL ¶ added in v1.0.5
func (r *RedisCache) TTL(key string) (time.Duration, error)
func (*RedisCache) Touch ¶
func (r *RedisCache) Touch(key string) error
func (*RedisCache) ZAdd ¶ added in v1.0.5
func (r *RedisCache) ZAdd(key string, members ...*redis.Z) (int64, error)
func (*RedisCache) ZRange ¶ added in v1.0.5
func (r *RedisCache) ZRange(key string, start, stop int64) ([]string, error)
func (*RedisCache) ZRank ¶ added in v1.0.5
func (r *RedisCache) ZRank(key, member string) (int64, error)
type Store ¶
type Store interface { Client() interface{} Key(key string) string Set(key, val string, expiration time.Duration) error Get(key string) (string, error) HGet(key, field string) (string, error) HGetAll(key string) (map[string]string, error) HSet(key string, values ...interface{}) (int64, error) HExists(key, field string) (bool, error) HMGet(key string, fields ...string) ([]interface{}, error) HMSet(key string, values ...interface{}) (bool, error) SCard(key string) (int64, error) SAdd(key string, members ...interface{}) (int64, error) SRem(key string, members ...interface{}) (int64, error) LRange(key string, start, stop int64) ([]string, error) LPush(key string, values ...interface{}) (int64, error) LLen(key string) (int64, error) RPop(key string) (string, error) RPopCount(key string, count int) ([]string, error) RPopLPush(source, destination string) (string, error) RPush(key string, values ...interface{}) (int64, error) RPushX(key string, values ...interface{}) (int64, error) ZAdd(key string, members ...*redis.Z) (int64, error) ZRange(key string, start, stop int64) ([]string, error) ZRank(key, member string) (int64, error) ZScore(key, member string) (float64, error) ZRem(key string, members ...interface{}) (int64, error) SetEX(key string, value interface{}, expiration time.Duration) (string, error) SetNX(key string, value interface{}, expiration time.Duration) (bool, error) HSetNX(key, field string, value interface{}) (bool, error) SScan(key string, cursor uint64, match string, count int64) ([]string, uint64, error) RunScript(src string, keys []string, args ...interface{}) (interface{}, error) GetBit(key string, offset int64) (int64, error) SetBit(key string, offset int64, value int) (int64, error) BitCount(key string, bitCount *redis.BitCount) (int64, error) BitOpAnd(destKey string, keys ...string) (int64, error) BitOpOr(destKey string, keys ...string) (int64, error) BitOpXor(destKey string, keys ...string) (int64, error) BitOpNot(destKey string, key string) (int64, error) BitPos(key string, bit int64, pos ...int64) (int64, error) BitField(key string, args ...interface{}) ([]int64, error) Del(keys ...string) (int64, error) Delete(key string) error DeleteByPrefix(prefix string) error HDel(key string, fields ...string) (int64, error) Incr(key string) (int64, error) Decr(key string) (int64, error) Type(key string) (string, error) TTL(key string) (time.Duration, error) Expire(key string, expiration time.Duration) (bool, error) Exists(keys ...string) (int64, error) Exist(key string) bool Touch(key string) error Flush() error // contains filtered or unexported methods }
Store Cache is the interface that operates the cache data.
Click to show internal directories.
Click to hide internal directories.