aredis

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Options       redis.Options
	Clients       *redis.Client
	Ctx           context.Context
	ClusterClient *redis.ClusterClient
	Mode          bool
}

New parameter structure

func New

func New(Addr, Password string, DB int) *Client

New setting redis

func NewClusterClient

func NewClusterClient(Addrs []string, Password string) *Client

NewClusterClient <Redis集群>

func NewFailoverClient

func NewFailoverClient(SentinelAddrs []string, MasterName, Password string, Db int) *Client

NewFailoverClient <Redis哨兵>

func (*Client) AddSet

func (c *Client) AddSet(key string, members ...interface{}) int64

AddSet value<修改集合>

func (*Client) AddZset

func (c *Client) AddZset(key string, value []*redis.Z) int64

AddSet value<修改集合>

func (*Client) Close

func (c *Client) Close()

Close <关闭>

func (*Client) Get

func (c *Client) Get(key string) string

Get value

func (*Client) GetList

func (c *Client) GetList(key string) []string

GetList value<获取列表>

func (*Client) GetListIndex

func (c *Client) GetListIndex(key string, index int64) string

GetListIndex value<返回名称为key的list中index位置的元素>

func (*Client) GetListLength

func (c *Client) GetListLength(key string) int64

GetList value<获取列表长度>

func (*Client) GetSet

func (c *Client) GetSet(key string) []string

GetSet value<获取集合>

func (*Client) GetSetLength

func (c *Client) GetSetLength(key string) int64

GetSetLength value<获取集合长度>

func (*Client) GetZsetLength

func (c *Client) GetZsetLength(key string) int64

GetSetLength value<获取集合长度>

func (*Client) GetZsetMember

func (c *Client) GetZsetMember(key string, score string) float64

GetZsetScore value<获取集合>

func (*Client) GetZsetRange

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

GetZsetRange value<获取有序集合>

func (*Client) GetZsetRangeByScore

func (c *Client) GetZsetRangeByScore(key string, opt *redis.ZRangeBy) []string

GetZsetRange value<返回有序集合指定区间内的成员分数从高到低>

func (*Client) GetZsetRevRange

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

GetZsetRange value<返回有序集合指定区间内的成员分数从高到低>

func (*Client) GetZsetScore

func (c *Client) GetZsetScore(key string, member string) int64

GetZsetScore value<获取集合>

func (*Client) Ping

func (c *Client) Ping() string

Ping <心跳>

func (*Client) PushList

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

PushList value<添加>

func (*Client) RemoveList

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

RemoveList value<删除列表> count 参数表示删除多少个key中的list

func (*Client) RemoveListLeft

func (c *Client) RemoveListLeft(key string) error

RemoveListLeft value<返回并删除名称为key的list中的首元素>

func (*Client) RemoveListRight

func (c *Client) RemoveListRight(key string) error

RemoveListRight value<返回并删除名称为key的list中的尾元素>

func (*Client) RemoveSet

func (c *Client) RemoveSet(key string, members ...interface{}) int64

GetSet value<获取集合>

func (*Client) RemoveZset

func (c *Client) RemoveZset(key string, members ...interface{}) int64

RemoveZset value<获取集合>

func (*Client) Set

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

Set value<设置读写> expiration<毫秒>

func (*Client) SetList

func (c *Client) SetList(key string, index int64, value interface{}) error

SetList value<修改列表>

func (*Client) SetNX

func (c *Client) SetNX(key string, value interface{}, expiration ...int64) bool

SetNX value<不存在才设置> expiration<毫秒>

func (*Client) SetOptions

func (c *Client) SetOptions(Options *redis.Options) *Client

SetOptions <修改配置>

func (*Client) TTL

func (c *Client) TTL(key string) time.Duration

TTL<获取过期时间>

Jump to

Keyboard shortcuts

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