rate

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

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

func NewLimiter

func NewLimiter(cost int, bucketSize int, dur time.Duration, throttle int) *Limiter

func (*Limiter) CheckTime

func (limter *Limiter) CheckTime()

func (*Limiter) GetBucketSize

func (limter *Limiter) GetBucketSize() int

func (*Limiter) GetStore

func (limter *Limiter) GetStore() int

func (*Limiter) IsAllowed

func (limter *Limiter) IsAllowed() bool

func (*Limiter) IsThrottled

func (limter *Limiter) IsThrottled() bool

func (*Limiter) Reset

func (limter *Limiter) Reset()

Jump to

Keyboard shortcuts

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