ratelimiter

package module
v0.0.0-...-94ae453 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

README

ratelimiter

A Rate Limiter implementation in Golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheBucket

func CacheBucket(initSize, maxSize, cacheMaxSize int, duration time.Duration) *cacheBucket

Types

type Bucket

type Bucket interface {
	Token() (Tokenizer, bool)
}

type Limiter

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

func NewLimiter

func NewLimiter(bucket Bucket) *Limiter

func (*Limiter) Try

func (l *Limiter) Try() (Tokenizer, bool)

type Tokenizer

type Tokenizer interface {
}

Jump to

Keyboard shortcuts

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