limiter

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(
	limiter *Limiter,
) func(http.Handler) http.Handler

Types

type Config

type Config struct {
	Enabled          bool
	Period           time.Duration
	Rate             int
	RedisAddr        string
	RedisClusterMode bool
	ProxyCount       int
}

type Limiter

type Limiter struct {
	Store      store.Store
	Rate       int
	Period     time.Duration
	ProxyCount int
}

func New

func New(config Config) *Limiter

Jump to

Keyboard shortcuts

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