sets_helper

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SetsHelper

type SetsHelper struct {
	*base.Base
}

SetsHelper Redis Sets类型助手类

func NewSetsHelper

func NewSetsHelper(b *base.Base) *SetsHelper

NewSetsHelper 实例化

func (SetsHelper) SAdd

func (s SetsHelper) SAdd(key, value string) (v *gvar.Var, err error)

SAdd 向集合添加一个成员

func (SetsHelper) SAdds

func (s SetsHelper) SAdds(key string, values []string) (v *gvar.Var, err error)

SAdds 向集合添加一个或多个成员

func (SetsHelper) SCard

func (s SetsHelper) SCard(key string) (v *gvar.Var, err error)

SCard 获取集合的成员数

func (SetsHelper) SDiff

func (s SetsHelper) SDiff(key string, otherKeys []string) (v *gvar.Var, err error)

SDiff 返回第一个集合与其他集合之间的差异。

func (SetsHelper) SDiffStore

func (s SetsHelper) SDiffStore(destKey string, keys []string) (v *gvar.Var, err error)

SDiffStore 返回给定所有集合的差集并存储在 destination 中

func (SetsHelper) SInter

func (s SetsHelper) SInter(key string, otherKeys []string) (v *gvar.Var, err error)

SInter 返回给定所有集合的交集

func (SetsHelper) SInterStore

func (s SetsHelper) SInterStore(destKey string, keys []string) (v *gvar.Var, err error)

SInterStore 返回给定所有集合的交集并存储在 destination 中

func (SetsHelper) SIsMember

func (s SetsHelper) SIsMember(key, value string) (v *gvar.Var, err error)

SIsMember 判断 member 元素是否是集合 key 的成员

func (SetsHelper) SMembers

func (s SetsHelper) SMembers(key string) (v *gvar.Var, err error)

SMembers Redis Smembers 命令返回集合中的所有的成员。 不存在的集合 key 被视为空集合。

func (SetsHelper) SMove

func (s SetsHelper) SMove(keySource, keyDestination string, value interface{}) (v *gvar.Var, err error)

SMove 将 member 元素从 source 集合移动到 destination 集合

func (SetsHelper) SPop

func (s SetsHelper) SPop(key string, count ...int) (v *gvar.Var, err error)

SPop 移除并返回集合中的一个随机元素

func (SetsHelper) SRandmember

func (s SetsHelper) SRandmember(key string, count ...int) (v *gvar.Var, err error)

SRandmember 返回集合中一个或多个随机数

func (SetsHelper) SRem

func (s SetsHelper) SRem(key string, values []string) (v *gvar.Var, err error)

SRem 移除集合中一个或多个成员

func (SetsHelper) SScan

func (s SetsHelper) SScan(key string, value string, callback func(key string, values []string) error, count ...int) (err error)

SScan 批量获取value 【注意】value里需要有通配符 比如:a:*

func (SetsHelper) SUnion

func (s SetsHelper) SUnion(key string, otherKeys []string) (v *gvar.Var, err error)

SUnion 返回所有给定集合的并集

func (SetsHelper) SUnionStore

func (s SetsHelper) SUnionStore(destKey string, keys []string) (v *gvar.Var, err error)

SUnionStore 所有给定集合的并集存储在 destination 集合中

Jump to

Keyboard shortcuts

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