limiter

package
v1.166.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(New),
)

Module for fx.

View Source
var NoKey = func(context.Context) meta.Valuer {
	return meta.Blank
}

NoKey for the limiter.

Functions

func IsEnabled added in v1.166.0

func IsEnabled(c *Config) bool

IsEnabled limiter.

func New

func New(cfg *Config) (*limiter.Limiter, error)

New limiter.

Types

type Config added in v1.166.0

type Config struct {
	Enabled bool   `yaml:"enabled,omitempty" json:"enabled,omitempty" toml:"enabled,omitempty"`
	Kind    string `yaml:"kind,omitempty" json:"kind,omitempty" toml:"kind,omitempty"`
	Pattern string `yaml:"pattern,omitempty" json:"pattern,omitempty" toml:"pattern,omitempty"`
}

Config for limiter.

type KeyFunc

type KeyFunc func(context.Context) meta.Valuer

KeyFunc for the limiter.

Jump to

Keyboard shortcuts

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