limiter

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: MIT Imports: 2 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)
	// SetWindow set a new window
	SetWindow(ctx context.Context, r Resource)
}

type Resource

type Resource struct {
	Name   string
	Limit  int
	Burst  int
	Window time.Duration
}

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
Package leakybucket is a generated GoMock package.
Package leakybucket is a generated GoMock package.
slidinglog
Package slidinglog is a generated GoMock package.
Package slidinglog is a generated GoMock package.

Jump to

Keyboard shortcuts

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