ratelimit

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLimitExceed = errors.New(429, "RATELIMIT", "service unavailable due to rate limit exceeded")

ErrLimitExceed is service unavailable due to rate limit exceeded.

Functions

func Server

func Server(opts ...Option) middleware.Middleware

Server ratelimiter middleware

Types

type Option

type Option func(*options)

Option is ratelimit option.

func WithLimiter

func WithLimiter(limiter ratelimit.Limiter) Option

WithLimiter set Limiter implementation, default is bbr limiter

Jump to

Keyboard shortcuts

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