limiter

package
v1.2.803 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Items

type Items struct {
	Rate ratelimit.Limiter
	// contains filtered or unexported fields
}

func NewItems

func NewItems(options ratelimit.Config, rep func(ratelimit.Config, int64)) *Items

type Limiter

type Limiter struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func GetDefaultLimiter

func GetDefaultLimiter() *Limiter

func New

func New() *Limiter

func (*Limiter) GetStats added in v1.1.4

func (c *Limiter) GetStats() (res []*proto.RateLimit)

func (*Limiter) Load

func (c *Limiter) Load(id string) *Items

func (*Limiter) LoadAll

func (c *Limiter) LoadAll() (res []*Items)

func (*Limiter) New

func (c *Limiter) New(option ratelimit.Config) *Items

func (*Limiter) NewOrLoad added in v1.2.803

func (c *Limiter) NewOrLoad(option ratelimit.Config) *Items

func (*Limiter) OnRateUpdate

func (c *Limiter) OnRateUpdate(id string, cb func(string, int64))

func (*Limiter) Remove added in v1.1.5

func (c *Limiter) Remove(option ratelimit.Config)

func (*Limiter) Reporter

func (c *Limiter) Reporter(cfg ratelimit.Config, cur int64)

type LimiterType

type LimiterType string
const LimiterServer LimiterType = "LimiterServer"

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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