limiter

package
v1.3.2-0...-4312943 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 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 Limiter

type Limiter interface {
	// TryHit tries to hit the limiter.
	TryHit(ctx context.Context, key string) (Result, error)
}

Limiter defines the limiter interface.

type Result

type Result struct {
	Limit     int
	Remaining int
	Reset     int64
	Reached   bool
}

Result defines the limiter result struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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