ratelimit

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 5 Imported by: 17

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