ratelimits

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: BSD-3-Clause, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RL_MAX_BITS = 8
	RL_GC_TIME  = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimits

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

func New

func New(hz, accuracy uint32) (*RateLimits, error)

func (*RateLimits) GcStart

func (rl *RateLimits) GcStart(dataTimeout, gcInterval time.Duration) error

func (*RateLimits) GcStop

func (rl *RateLimits) GcStop()

func (*RateLimits) Len

func (rl *RateLimits) Len() int

func (*RateLimits) Update

func (rl *RateLimits) Update(key string) bool

Jump to

Keyboard shortcuts

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