Documentation ¶
Index ¶
- type Cache
- func (c *Cache) Decr(ctx context.Context, key string) (int64, error)
- func (c *Cache) DecrBy(ctx context.Context, key string, value int64) (int64, error)
- func (c *Cache) Delete(ctx context.Context, key string) error
- func (c *Cache) Exists(ctx context.Context, keys ...string) int64
- func (c *Cache) Get(ctx context.Context, key string) ([]byte, error)
- func (c *Cache) GetSMembers(ctx context.Context, key string) ([]string, error)
- func (c *Cache) GetVal(ctx context.Context, key string) (string, error)
- func (c *Cache) Incr(ctx context.Context, key string) (int64, error)
- func (c *Cache) IncrBy(ctx context.Context, key string, value int64) (int64, error)
- func (c *Cache) LGet(ctx context.Context, key string) ([]byte, error)
- func (c *Cache) LLen(ctx context.Context, key string) (int64, error)
- func (c *Cache) LList(ctx context.Context, key string) ([]string, error)
- func (c *Cache) LRange(ctx context.Context, key string, from int, to int) ([]string, error)
- func (c *Cache) LSet(ctx context.Context, key string, val []byte) error
- func (c *Cache) RSet(ctx context.Context, key string, val []byte) error
- func (c *Cache) Set(ctx context.Context, key string, value []byte) error
- func (c *Cache) SetExpireTime(ctx context.Context, key string, seconds int64) error
- func (c *Cache) SetNX(ctx context.Context, key string, seconds int64, data interface{}) (bool, error)
- func (c *Cache) SetObject(ctx context.Context, key string, val interface{}, duration time.Duration) error
- func (c *Cache) SetSAdd(ctx context.Context, key string, members ...interface{}) error
- func (c *Cache) SetVal(ctx context.Context, key string, value string) error
- func (c *Cache) SetWithDuration(ctx context.Context, key string, value []byte, duration time.Duration) error
- func (c *Cache) ZAdd(ctx context.Context, key string, score float64, member string) error
- func (c *Cache) ZIncrBy(ctx context.Context, key string, increment float64, member string) error
- func (c *Cache) ZRange(ctx context.Context, key string, start int64, stop int64) ([]string, error)
- func (c *Cache) ZRemRangeByRank(ctx context.Context, key string, start int64, stop int64) error
- func (c *Cache) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]redis.Z, error)
- func (c *Cache) ZRevRank(ctx context.Context, key string, member string) (int64, error)
- func (c *Cache) ZScore(ctx context.Context, key string, member string) (float64, error)
- type ICache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache structure
func (*Cache) GetSMembers ¶
func (*Cache) SetExpireTime ¶
func (*Cache) SetWithDuration ¶
func (c *Cache) SetWithDuration(ctx context.Context, key string, value []byte, duration time.Duration) error
SetWithDuration ...
func (*Cache) ZRemRangeByRank ¶
ZRemRangeByRank ...
func (*Cache) ZRevRangeWithScores ¶
func (c *Cache) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]redis.Z, error)
ZRevRangeWithScores ...
type ICache ¶
type ICache interface { Get(ctx context.Context, key string) ([]byte, error) Set(ctx context.Context, key string, value []byte) error SetObject(ctx context.Context, key string, val interface{}, duration time.Duration) error Delete(ctx context.Context, key string) error SetWithDuration(ctx context.Context, key string, value []byte, duration time.Duration) error SetExpireTime(ctx context.Context, key string, seconds int64) error Exists(ctx context.Context, keys ...string) int64 LSet(ctx context.Context, key string, vals []byte) error RSet(ctx context.Context, key string, val []byte) error LLen(ctx context.Context, key string) (int64, error) LGet(ctx context.Context, key string) ([]byte, error) LList(ctx context.Context, key string) ([]string, error) Incr(ctx context.Context, key string) (int64, error) Decr(ctx context.Context, key string) (int64, error) DecrBy(ctx context.Context, key string, value int64) (int64, error) IncrBy(ctx context.Context, key string, value int64) (int64, error) SetVal(ctx context.Context, key string, value string) error GetVal(ctx context.Context, key string) (string, error) LRange(ctx context.Context, key string, from int, to int) ([]string, error) ZAdd(ctx context.Context, key string, score float64, member string) error ZRange(ctx context.Context, key string, start int64, stop int64) ([]string, error) ZRemRangeByRank(ctx context.Context, key string, start int64, stop int64) error ZIncrBy(ctx context.Context, key string, increment float64, member string) error ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]redis.Z, error) ZRevRank(ctx context.Context, key string, member string) (int64, error) ZScore(ctx context.Context, key string, member string) (float64, error) GetSMembers(ctx context.Context, key string) ([]string, error) SetSAdd(ctx context.Context, key string, members ...interface{}) error SetNX(ctx context.Context, key string, seconds int64, data interface{}) (bool, error) }
ICache interface for plain cache
Click to show internal directories.
Click to hide internal directories.