ratelimit

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 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