his

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQueue

func NewQueue(rd *redis.Pool, minLength int, autoPushFunc func(LetterId string, gender uint, countryCode string) []int32) *queue

Types

type Exist

type Exist interface {
	IsExist(key string) (bool, error)     //key是否存在
	Add(key string)                       //添加存在
	Del(key string)                       //移除存在
	Count() (sum int, err error)          //一共有多少个key
	GetAllKey() (all []string, err error) //返回所有的key
}

func NewExist

func NewExist(Topic string, rd *redis.Pool) Exist

创建一个是否存在记录表

type KeyValue

type KeyValue interface {
	Set(key string, value string)
	Get(key string) (value string, err error)
	Del(key string)
}

func NewKeyValue

func NewKeyValue(Topic string, rd *redis.Pool) KeyValue

创建一个kv表

type Limit

type Limit interface {
	Add(key string, delta int)                                //记录量自增
	Sub(key string, delta int)                                //记录量自减
	Get(key string) (cur int, e error)                        //获取当前量
	Reset(key string) (cur int, e error)                      //重置为0
	IsToLimit(key string, max int) (b bool, cur int, e error) //是否达上限值
}

Limit 记录上限

func NewLimit

func NewLimit(Topic string, rd *redis.Pool) Limit

创建一个记录上限器

Jump to

Keyboard shortcuts

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