redis

package
v0.0.0-...-7afedfb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ResultNil = redis.Nil

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Cc *redis.Client
	// contains filtered or unexported fields
}

Client is for

func GetInstance

func GetInstance(log logger.Logger, cfg *RedisCfg) (*Client, error)

func (*Client) BLPOP

func (c *Client) BLPOP(key string, t time.Duration) ([]string, error)

BLPOP is for

func (*Client) DEL

func (c *Client) DEL(key ...string) (int64, error)

DEL is for

func (*Client) EXISTS

func (c *Client) EXISTS(key string) (bool, error)

func (*Client) EXPIRE

func (c *Client) EXPIRE(key string, dur time.Duration) error

EXPIRE is for

func (*Client) Eval

func (c *Client) Eval(script string, keys []string, args ...interface{}) (interface{}, error)

func (*Client) EvalSha

func (c *Client) EvalSha(sha1 string, keys []string, args ...interface{}) (interface{}, error)

func (*Client) GET

func (c *Client) GET(key string) (string, error)

GET is for

func (*Client) HDEL

func (c *Client) HDEL(key string, field string) (int64, error)

HGET is for

func (*Client) HEXISTS

func (c *Client) HEXISTS(key string, field string) (bool, error)

func (*Client) HGET

func (c *Client) HGET(key string, field string) (string, error)

HGET is for

func (*Client) HGETALL

func (c *Client) HGETALL(key string) (map[string]string, error)

HGETALL is for

func (*Client) HINCR

func (c *Client) HINCR(key string, feild string, value int64) (int64, error)

func (*Client) HINCRFLOAT

func (c *Client) HINCRFLOAT(key string, feild string, value float64) (float64, error)

func (*Client) HKEYS

func (c *Client) HKEYS(key string) ([]string, error)

func (*Client) HMGET

func (c *Client) HMGET(name string, keys ...string) ([]interface{}, error)

HMGET is for

func (*Client) HMSET

func (c *Client) HMSET(name string, kv map[string]interface{}) error

HMSET is for

func (*Client) HSET

func (c *Client) HSET(name string, key string, value interface{}) error

HSET is for

func (*Client) INCR

func (c *Client) INCR(key string, value int64) (int64, error)

INCR is for

func (*Client) KEYS

func (c *Client) KEYS(key string) ([]string, error)

func (*Client) LRANGE

func (c *Client) LRANGE(key string, start, stop int64) ([]string, error)

RPUSH is for

func (*Client) Pipeline

func (c *Client) Pipeline() (redis.Pipeliner, error)

func (*Client) RPUSH

func (c *Client) RPUSH(key string, value ...interface{}) (int64, error)

RPUSH is for

func (*Client) SADD

func (c *Client) SADD(key string, values ...interface{}) error

SADD is for

func (*Client) SET

func (c *Client) SET(key string, value interface{}, t time.Duration) (string, error)

SET is for

func (*Client) SETNX

func (c *Client) SETNX(key string, value interface{}, t time.Duration) (bool, error)

SETNX is for

func (*Client) SMEMBERS

func (c *Client) SMEMBERS(key string) ([]string, error)

SMEMBERS is ofr

func (*Client) SPOP

func (c *Client) SPOP(key string) (string, error)

func (*Client) SREM

func (c *Client) SREM(key string, values ...interface{}) error

SREM is for

func (*Client) ScriptExists

func (c *Client) ScriptExists(sha ...string) ([]bool, error)

func (*Client) ScriptLoad

func (c *Client) ScriptLoad(script string) (string, error)

func (*Client) XACK

func (c *Client) XACK(stream, group string, ids ...string) error

XACK ack target message.

func (*Client) XADD

func (c *Client) XADD(stream, id string, maxlen int64, vals map[string]interface{}) error

XADD interface{} value is only support string and numeric value.

func (*Client) XADDJSON

func (c *Client) XADDJSON(stream string, vals map[string]interface{}) error

XADDJSON is for add message to stream, if stream not exist, stream will create. XADDJSON will format all interface{} value to json str.

func (*Client) XCLAIM

func (c *Client) XCLAIM(stream, group, consumer string, minIdle time.Duration, ids ...string) error

XCLAIM reclaim pending message to target consumer.

func (*Client) XGROUP_CREATE

func (c *Client) XGROUP_CREATE(stream, group, start string) (string, error)

XGROUP_CREATE create consumer group.

func (*Client) XGROUP_DELCONSUMER

func (c *Client) XGROUP_DELCONSUMER(stream, group, consumer string) error

XGROUP_DELCONSUMER delete consumer from group.

func (*Client) XGROUP_DELETE

func (c *Client) XGROUP_DELETE(stream, group string) error

XGROUP_DELETE delete consumer group.

func (*Client) XGROUP_READ

func (c *Client) XGROUP_READ(stream, group, consumer, start string, count int64, timeout time.Duration, noAck bool, jsonDecode bool) (*map[string]map[string]interface{}, error)

XGROUP_READ is for read message from stream

func (*Client) XGROUP_SETID

func (c *Client) XGROUP_SETID(stream, group, start string) error

XGROUP_SETID modify consumer group start.

func (*Client) XINFO_GROUPS

func (c *Client) XINFO_GROUPS(stream string) (*map[string]map[string]interface{}, error)

XINFO_GROUPS is for get stream group info

func (*Client) XPENDING_SCAN

func (c *Client) XPENDING_SCAN(stream, group, consumer, start, end string, count int64) (*map[string]map[string]interface{}, error)

XPENDING_SCAN is for read message only received not ack.

func (*Client) ZADD

func (c *Client) ZADD(name string, score float64, member interface{}) error

ZADD is for

func (*Client) ZPOPMAX

func (c *Client) ZPOPMAX(key string) ([]redis.Z, error)

ZPOPMAX is for

func (*Client) ZPOPMIN

func (c *Client) ZPOPMIN(key string) ([]redis.Z, error)

ZPOPMIN is for

func (*Client) ZRANGE

func (c *Client) ZRANGE(key string, start int64, stop int64) ([]string, error)

ZRANGE is for

func (*Client) ZREM

func (c *Client) ZREM(name string, member string) error

ZREM is for

func (*Client) ZRevRangeByScore

func (c *Client) ZRevRangeByScore(key, min, max string, count int64) ([]string, error)

ZRevRangeByScore is for

type RedisCfg

type RedisCfg struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Dbname   int    `json:"dbname"`
	PassWord string `json:"pwd"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL