golimiter

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: LGPL-3.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 Bucket

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

func NewBucket

func NewBucket(token int) *Bucket

func (*Bucket) Access

func (b *Bucket) Access(cyc, incr, decr int) bool

type Limiter

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

func New

func New(cap, cyc int) *Limiter

func (*Limiter) Access

func (l *Limiter) Access(id string, incr, decr int) bool

func (*Limiter) GetCap

func (l *Limiter) GetCap() int

func (*Limiter) GetCyc

func (l *Limiter) GetCyc() int

Jump to

Keyboard shortcuts

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