limiter

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry interface {
	Allow() bool
	Finish()
	Error() error
}

type Limiter

type Limiter interface {
	// Check check can process
	Check(ctx context.Context, r Resource) Entry
	// SetLimit set a new limit
	SetLimit(ctx context.Context, r Resource)
	// SetBurst set a new burst
	SetBurst(ctx context.Context, r Resource)
}

type Resource

type Resource struct {
	Name  string
	Limit int
	Burst int
}

Directories

Path Synopsis
alone
leakybucket
Reference uber ratelimit, the different is support no wait take func
Reference uber ratelimit, the different is support no wait take func
slidingwindow
Package slidingwindow is a generated GoMock package.
Package slidingwindow is a generated GoMock package.
distributed
leakybucket
Reference uber ratelimit, the different is support no wait take func
Reference uber ratelimit, the different is support no wait take func

Jump to

Keyboard shortcuts

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