ratelimit

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decision

type Decision struct {
	Allowed    bool
	RetryAfter time.Duration
}

type OtterStore

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

func NewOtterStore

func NewOtterStore(capacity int) (*OtterStore, error)

func (*OtterStore) Allow

func (s *OtterStore) Allow(key string, max int, window time.Duration) (Decision, error)

func (*OtterStore) Close

func (s *OtterStore) Close()

type Store

type Store interface {
	Allow(key string, max int, window time.Duration) (Decision, error)
}

Jump to

Keyboard shortcuts

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