restrictor

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Restrictor

type Restrictor struct {
	// contains filtered or unexported fields
}

Restrictor 节流器

func New

func New(accessCheck func(startTime *int64, nowNum *int64) bool) *Restrictor

New 创建节流器

func (*Restrictor) GC

func (z *Restrictor) GC()

GC 清理无用的数据

func (*Restrictor) Record

func (z *Restrictor) Record(id interface{}) bool

Record 记录访问

func (*Restrictor) WebsocketCount

func (z *Restrictor) WebsocketCount(functionName string, replier *WebsocketDealer.Replier, session *WebsocketDealer.Session, args []interface{}) bool

WebsocketCount For rrpc

Jump to

Keyboard shortcuts

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