ratelimit

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyFn

type KeyFn func(*http.Request) string

type Middleware

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

func New

func New(opts Options) *Middleware

func (*Middleware) Handler

func (m *Middleware) Handler(next http.Handler) http.Handler

type Options

type Options struct {
	Capacity   float64 // tokens
	RefillRate float64 // tokens per second
	Key        KeyFn   // how to key buckets
	RetryAfter time.Duration
}

Jump to

Keyboard shortcuts

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