Documentation
¶
Index ¶
- func GetDailyLimitKey(mid int64) string
- func GetIntervalKey(mid int64) string
- func PromError(name string)
- func PromInfo(name string)
- func PromInfoAdd(name string, value int64)
- type Dao
- func (d *Dao) BatchPush(fans *[]int64, task *model.ApPushTask) (total int)
- func (d *Dao) Close() (err error)
- func (d *Dao) CreateNewTask(c context.Context, task *model.ApPushTask) (affected int64, err error)
- func (d *Dao) Fans(c context.Context, upper int64, types int) (fans map[int64]bool, fansSP map[int64]bool, err error)
- func (d *Dao) GetBlackList(c context.Context, task *model.ApPushTask) (mids map[int64]bool, err error)
- func (d *Dao) GetFansBySwitch(c context.Context, targetID int64) (fans map[int64]bool, err error)
- func (d *Dao) GetPushConfig(c context.Context) (types []string, err error)
- func (d *Dao) GetPushInterval(c context.Context) (interval int32, err error)
- func (d *Dao) GetPushTemplate(group string, part string) (template string)
- func (d *Dao) GetUUID(task *model.ApPushTask, times int) string
- func (d *Dao) NewFilter(conf *FilterConfig) (f *Filter, err error)
- func (d *Dao) NewFilterChain(f *Filter) FilterChain
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) Push(fans []int64, task *model.ApPushTask, uuid string) (err error)
- func (d *Dao) RedisOption() []redis.DialOption
- func (d *Dao) SeparateFans(c context.Context, upper int64, fansIn map[int64]bool) (fans map[int64]bool, fansSP map[int64]bool, err error)
- type Filter
- type FilterChain
- type FilterConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDailyLimitKey ¶
GetDailyLimitKey return daily limit redis key
func GetIntervalKey ¶
GetIntervalKey return interval smooth redis key
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao dao
func (*Dao) BatchPush ¶
func (d *Dao) BatchPush(fans *[]int64, task *model.ApPushTask) (total int)
BatchPush 批量推送,失败重试
func (*Dao) CreateNewTask ¶
CreateNewTask 新增推送任务记录
func (*Dao) Fans ¶
func (d *Dao) Fans(c context.Context, upper int64, types int) (fans map[int64]bool, fansSP map[int64]bool, err error)
Fans gets the upper's fans.
func (*Dao) GetBlackList ¶
func (d *Dao) GetBlackList(c context.Context, task *model.ApPushTask) (mids map[int64]bool, err error)
GetBlackList get blacklist from hbase by target id
func (*Dao) GetFansBySwitch ¶
GetFansBySwitch 获取直播开关数据
func (*Dao) GetPushConfig ¶
GetPushConfig 从DB中获取推送配置
func (*Dao) GetPushInterval ¶
GetPushInterval 获取推送时间间隔
func (*Dao) GetPushTemplate ¶
GetPushTemplate 根据类型返回不同的推送文案
func (*Dao) GetUUID ¶
func (d *Dao) GetUUID(task *model.ApPushTask, times int) string
GetUUID 构造一个每次请求的uuid
func (*Dao) NewFilter ¶
func (d *Dao) NewFilter(conf *FilterConfig) (f *Filter, err error)
NewFilter NewFilter
func (*Dao) NewFilterChain ¶
func (d *Dao) NewFilterChain(f *Filter) FilterChain
NewFilterChain NewFilterChain
func (*Dao) RedisOption ¶
func (d *Dao) RedisOption() []redis.DialOption
RedisOption return redis options
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter Filter
func (*Filter) BatchDecreaseLimit ¶
BatchDecreaseLimit 批量减少配额
func (*Filter) BatchFilter ¶
func (f *Filter) BatchFilter(ctx context.Context, filterChain FilterChain, mids []int64) (resMids []int64)
BatchFilter 对输入mid序列执行所有过滤方法,返回过滤结果
type FilterChain ¶
FilterChain FilterChain
type FilterConfig ¶
type FilterConfig struct { Business int IntervalExpired int32 IntervalValue string DailyExpired float64 Task *model.ApPushTask }
FilterConfig FilterConfig
Click to show internal directories.
Click to hide internal directories.