Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ICache ¶
type ICache interface { Close() Get(ctx context.Context, key string) (string, error) GetInt(ctx context.Context, key string) (int, error) Set(ctx context.Context, key string, value interface{}, expire int) error Del(ctx context.Context, key string) error Incr(ctx context.Context, key string) (int64, error) Exists(ctx context.Context, key string) (bool, error) Expire(ctx context.Context, key string, expire int) error SAdd(ctx context.Context, key string, members ...interface{}) error SMembers(ctx context.Context, key string) ([]string, error) SRem(ctx context.Context, key string, members ...interface{}) error SCard(ctx context.Context, key string) (int64, error) SIsMember(ctx context.Context, key string, member interface{}) (bool, error) HSet(ctx context.Context, key string, kv ...interface{}) error HGet(ctx context.Context, key, field string) (string, error) HMSet(ctx context.Context, key string, kvs ...interface{}) error HMGet(ctx context.Context, key string, fields ...string) ([]interface{}, error) HGetAll(ctx context.Context, key string) (map[string]string, error) HExists(ctx context.Context, key, filed string) (bool, error) HDel(ctx context.Context, key string, fields ...string) error ZAdd(ctx context.Context, key string, list map[string]float64) error ZRangeByScore(ctx context.Context, key string, min, max string, off, lim int64) ([]string, error) ZRevRangeByScore(ctx context.Context, key string, min, max string, off, lim int64) ([]string, error) ZRem(ctx context.Context, key string, members ...interface{}) error Keys(ctx context.Context, pattern string) ([]string, error) }
ICache 缓存接口
func NewRedisCacheWithParams ¶
NewRedisCacheWithParams 根据参数创建redis缓存
Click to show internal directories.
Click to hide internal directories.