Documentation ¶
Index ¶
- func Bool(reply interface{}, err error) (bool, error)
- func ByteSlices(reply interface{}, err error) ([][]byte, error)
- func Bytes(reply interface{}, err error) ([]byte, error)
- func Float64(reply interface{}, err error) (float64, error)
- func Float64s(reply interface{}, err error) ([]float64, error)
- func Int(reply interface{}, err error) (int, error)
- func Int64(reply interface{}, err error) (int64, error)
- func Int64Map(result interface{}, err error) (map[string]int64, error)
- func Int64s(reply interface{}, err error) ([]int64, error)
- func IntMap(result interface{}, err error) (map[string]int, error)
- func Ints(reply interface{}, err error) ([]int, error)
- func Positions(result interface{}, err error) ([]*[2]float64, error)
- func String(reply interface{}, err error) (string, error)
- func StringMap(result interface{}, err error) (map[string]string, error)
- func Strings(reply interface{}, err error) ([]string, error)
- func Struct(result interface{}, err error, v ...interface{}) error
- func Uint64(reply interface{}, err error) (uint64, error)
- func Values(reply interface{}, err error) ([]interface{}, error)
- type Client
- func (c *Client) BLPop(ctx context.Context, key string, timeout int) (interface{}, error)
- func (c *Client) BRPop(ctx context.Context, key string, timeout int) (interface{}, error)
- func (c *Client) Close() error
- func (c *Client) DeleteKey(ctx context.Context, key string) (bool, error)
- func (c *Client) Do(ctx context.Context, command string, args ...interface{}) (reply interface{}, err error)
- func (c *Client) DoWithMetric(redisConn redis.Conn, cmd string, args ...interface{}) (interface{}, error)
- func (c *Client) Exists(ctx context.Context, key string) (bool, error)
- func (c *Client) Expire(ctx context.Context, key string, expiration int64) error
- func (c *Client) Get(ctx context.Context, key string) (string, error)
- func (c *Client) GetBytes(ctx context.Context, key string) ([]byte, error)
- func (c *Client) GetInt(ctx context.Context, key string) (int, error)
- func (c *Client) GetRedisConn() redis.Conn
- func (c *Client) HGet(ctx context.Context, key, field string) ([]byte, error)
- func (c *Client) HGetAll(ctx context.Context, key string, val interface{}) error
- func (c *Client) HMGet(ctx context.Context, key string, field ...interface{}) ([]string, error)
- func (c *Client) HMSet(ctx context.Context, key string, val interface{}) error
- func (c *Client) HSet(ctx context.Context, key string, field string, val interface{}) error
- func (c *Client) IncrBy(ctx context.Context, key string, step int) (int, error)
- func (c *Client) LPop(ctx context.Context, key string) (interface{}, error)
- func (c *Client) LPush(ctx context.Context, key string, val interface{}) error
- func (c *Client) LRange(ctx context.Context, key string, start, end int) (interface{}, error)
- func (c *Client) Ping() error
- func (c *Client) RPop(ctx context.Context, key string) (interface{}, error)
- func (c *Client) RPush(ctx context.Context, key string, val interface{}) error
- func (c *Client) SAdd(ctx context.Context, key string, fields []interface{}) (bool, error)
- func (c *Client) SMembers(ctx context.Context, key string) (interface{}, error)
- func (c *Client) SRem(ctx context.Context, key string, members []interface{}) (interface{}, error)
- func (c *Client) SelectDB(ctx context.Context, db int) error
- func (c *Client) Set(ctx context.Context, key string, val interface{}, expiration int64) error
- func (c *Client) SisMember(ctx context.Context, key string, member interface{}) (interface{}, error)
- func (c *Client) Stats()
- func (c *Client) SubChannels(ctx context.Context, onStart func() error, ...) error
- func (c *Client) TraceWithSpanContext(spCtx opentracing.SpanContext) *TraceClient
- func (c *Client) ZAdd(ctx context.Context, key string, score int64, member string) (interface{}, error)
- func (c *Client) ZRange(ctx context.Context, key string, from, to int64) (map[string]int64, error)
- func (c *Client) ZRank(ctx context.Context, key, member string) (int64, error)
- func (c *Client) ZRem(ctx context.Context, key string, member string) (interface{}, error)
- func (c *Client) ZRevrank(ctx context.Context, key, member string) (int64, error)
- func (c *Client) ZScore(ctx context.Context, key string, member string) (int64, error)
- type Option
- type TraceClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteSlices ¶
refer redis.ByteSlices.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BLPop ¶
------------------------------------------------------------ // --------------------------- LIST ------------------------- // ----------------------------------------------------------- // timeout 单位s, 0表示无限期阻塞
func (*Client) DoWithMetric ¶
func (*Client) Get ¶
------------------------------------------------------------ // --------------------------- STRING ------------------------- // ----------------------------------------------------------- // GET
func (*Client) GetRedisConn ¶
func (*Client) HSet ¶
------------------------------------------------------------ // --------------------------- HASH ------------------------- // ----------------------------------------------------------- //
func (*Client) LRange ¶
区间以偏移量 start 和 end 0 表示列表的第一个元素, 1 表示列表的第二个元素,以此类推。 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。 end (闭区间)
func (*Client) SAdd ¶
------------------------------------------------------------ // --------------------------- SET --------------------------- // ----------------------------------------------------------- //
func (*Client) SubChannels ¶
func (*Client) TraceWithSpanContext ¶
func (c *Client) TraceWithSpanContext(spCtx opentracing.SpanContext) *TraceClient
func (*Client) ZAdd ¶
func (c *Client) ZAdd(ctx context.Context, key string, score int64, member string) (interface{}, error)
------------------------------------------------------------ // ------------------------ SORTED SET ----------------------- // ----------------------------------------------------------- //
func (*Client) ZRange ¶
ZRange 返回有序集中,指定区间内的成员。其中成员的位置按分数值递增(从小到大)来排序。具有相同分数值的成员按字典序来排列。 以 0 表示有序集第一个成员,以 1 表示有序集第二个成员,以此类推。或 以 -1 表示最后一个成员, -2 表示倒数第二个成员,以此类推。
type TraceClient ¶
type TraceClient struct { *Client // contains filtered or unexported fields }