Documentation ¶
Overview ¶
Package pkg 计数器,可以用于业务的各种模型统计使用 场景:常用于重复策略,或者反作弊处理控制
Package pkg ID 分配器,主要使用redis进行分配 ¶
Package pkg 重复提交模型封装
Index ¶
- Constants
- type CRepeat
- func (c *CRepeat) Del(userID int64, check string) int64
- func (c *CRepeat) Get(userID int64, check string) (interface{}, error)
- func (c *CRepeat) Set(userID int64, check string, value interface{}, expiration time.Duration) error
- func (c *CRepeat) SetNX(userID int64, check string, value interface{}, expiration time.Duration) (bool, error)
- type Counter
- type IDAlloc
Constants ¶
View Source
const ( // PrefixCounter counter key PrefixCounter = "eagle:counter:%s" // DefaultStep default step key DefaultStep = 1 // DefaultExpirationTime . DefaultExpirationTime = 600 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRepeat ¶
type CRepeat struct {
// contains filtered or unexported fields
}
CRepeat define struct
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter define struct
func (*Counter) DelCounter ¶
DelCounter del count
func (*Counter) GetCounter ¶
GetCounter get total count
Click to show internal directories.
Click to hide internal directories.