Documentation
¶
Index ¶
- Constants
- func EvalInt64(reply interface{}, err error) (int64, error)
- func GetSync(name string) (lock *redsync.Redsync)
- func IsCacheMiss(err error) bool
- type Client
- func (c *Client) Decr(ctx context.Context, key string, value int64) (result int64, err error)
- func (c *Client) Del(ctx context.Context, key string) (err error)
- func (c *Client) Eval(ctx context.Context, script string, keys []string, argvs ...interface{}) (reply interface{}, err error)
- func (c *Client) Exists(ctx context.Context, keys ...string) (result bool, err error)
- func (c *Client) Expire(ctx context.Context, key string, ttl int32) (err error)
- func (c *Client) Get(ctx context.Context, key string) (value string, err error)
- func (c *Client) HDel(ctx context.Context, hashKey, key string) (err error)
- func (c *Client) HGet(ctx context.Context, hashKey, key string) (value string, err error)
- func (c *Client) HGetAll(ctx context.Context, hashKey string) (list map[string]string, err error)
- func (c *Client) HIncrBy(ctx context.Context, hashKey, key string, value int64) (result int64, err error)
- func (c *Client) HSet(ctx context.Context, hashKey, key, value string) (err error)
- func (c *Client) Incr(ctx context.Context, key string, value int64) (result int64, err error)
- func (c *Client) LPOP(ctx context.Context, key string) (value string, err error)
- func (c *Client) LPUSH(ctx context.Context, key, value string) (err error)
- func (c *Client) Llen(ctx context.Context, key string) (value int, err error)
- func (c *Client) RPOP(ctx context.Context, key string) (value string, err error)
- func (c *Client) RPUSH(ctx context.Context, key, value string) (err error)
- func (c *Client) SAdd(ctx context.Context, key, value string) (err error)
- func (c *Client) SIsMember(ctx context.Context, key, value string) (isMember int, err error)
- func (c *Client) SMembers(ctx context.Context, key string) (list []string, err error)
- func (c *Client) SRem(ctx context.Context, key, value string) (err error)
- func (c *Client) Set(ctx context.Context, key, value string) (err error)
- func (c *Client) SetNx(ctx context.Context, key string, value string, expire int32) (success bool, err error)
- func (c *Client) SetPx(ctx context.Context, key string, value string, expire int32) (err error)
- func (c *Client) TTL(ctx context.Context, key string) (ttl int, err error)
- type Option
Constants ¶
View Source
const (
// ModelOfMaster 主从模式,默认是哨兵模式,需要配置/环境变量: olympus.redis.${name}.mode: "master"
ModelOfMaster = "master"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client redis client 封装
func (*Client) Eval ¶
func (c *Client) Eval(ctx context.Context, script string, keys []string, argvs ...interface{}) (reply interface{}, err error)
Eval 运行脚本
func (*Client) HIncrBy ¶
func (c *Client) HIncrBy(ctx context.Context, hashKey, key string, value int64) (result int64, err error)
HIncrBy hash set 增加 key 指定的哈希集中指定字段的数值
func (*Client) SetNx ¶
func (c *Client) SetNx(ctx context.Context, key string, value string, expire int32) (success bool, err error)
SetNx 如果key不存在,则将value写入, 同时设置key的超时时间(毫秒) 返回是否写入成功
Click to show internal directories.
Click to hide internal directories.