Documentation
¶
Index ¶
- type Cache
- func (c *Cache) Client() *redis.Client
- func (c *Cache) Close() error
- func (c *Cache) Delete(ctx context.Context, key string) error
- func (c *Cache) Get(ctx context.Context, key string) (string, error)
- func (c *Cache) GetBytes(ctx context.Context, key string) ([]byte, error)
- func (c *Cache) GetInt64(ctx context.Context, key string) (int64, error)
- func (c *Cache) GetJSON(ctx context.Context, key string, v interface{}) error
- func (c *Cache) HDel(ctx context.Context, key, field string) error
- func (c *Cache) HGet(ctx context.Context, key, field string) (string, error)
- func (c *Cache) HGetAll(ctx context.Context, key string) (map[string]string, error)
- func (c *Cache) HGetAllMulti(ctx context.Context, keys []string) ([]map[string]string, error)
- func (c *Cache) HIncrBy(ctx context.Context, key, field string, delta int64) (int64, error)
- func (c *Cache) HSet(ctx context.Context, key, field, value string) error
- func (c *Cache) Incr(ctx context.Context, key string) (int64, error)
- func (c *Cache) MGetBytes(ctx context.Context, keys ...string) ([][]byte, error)
- func (c *Cache) Set(ctx context.Context, key, val string) error
- func (c *Cache) SetInt64(ctx context.Context, key string, val int64) error
- func (c *Cache) SetJSON(ctx context.Context, key string, val interface{}) error
- func (c *Cache) SetTTL(ctx context.Context, key string, ttl int64) error
- func (c *Cache) SetTimed(ctx context.Context, key, val string, ttl int64) error
- func (c *Cache) SetTimedInt64(ctx context.Context, key string, val int64, ttl int64) error
- func (c *Cache) SetTimedJSON(ctx context.Context, key string, val interface{}, ttl int64) error
- func (c *Cache) SetTimedJSONBatch(ctx context.Context, keys []string, vals []interface{}, ttl int64) error
- func (c *Cache) SetTimedJSONNX(ctx context.Context, key string, val interface{}, ttl int64) (bool, error)
- func (c *Cache) XAdd(ctx context.Context, stream string, maxLen int64, approx bool, ...) error
- func (c *Cache) ZAdd(ctx context.Context, key string, score float64, member string) error
- func (c *Cache) ZAddBatch(ctx context.Context, key string, members []cache.ZBatchMember) error
- func (c *Cache) ZRem(ctx context.Context, key string, members ...string) error
- func (c *Cache) ZRevRangeByScore(ctx context.Context, key, max, min string, offset, count int64) ([]string, error)
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
}
func (*Cache) HGetAllMulti ¶ added in v1.10.0
HGetAllMulti pipelines len(keys) HGETALL commands in a single round-trip.
func (*Cache) MGetBytes ¶ added in v1.10.0
MGetBytes fetches multiple keys in a single MGET round-trip.
func (*Cache) SetTimedInt64 ¶
SetTimedInt64 set int64 value with expiration time in seconds
func (*Cache) SetTimedJSON ¶
func (*Cache) SetTimedJSONBatch ¶ added in v1.10.0
func (c *Cache) SetTimedJSONBatch(ctx context.Context, keys []string, vals []interface{}, ttl int64) error
SetTimedJSONBatch pipelines N SETEX commands in a single round-trip.
func (*Cache) SetTimedJSONNX ¶ added in v1.7.0
func (*Cache) ZAddBatch ¶ added in v1.10.0
ZAddBatch adds multiple members to a sorted set in one ZADD command.
Click to show internal directories.
Click to hide internal directories.