limiter

package
v1.0.1004 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 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

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

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

func (*Limiter) OnRateUpdate

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

func (*Limiter) Remove

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