throttling

package
v0.0.0-...-cd796bd Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LimitHandler

type LimitHandler struct {
	// contains filtered or unexported fields
}

LimitHandler is middleware which limits the current number of active connections that this handler can sustain. Once the current connections equal the max http.StatusTooManyRequests is returned

func NewLimitHandler

func NewLimitHandler(connections int, next http.Handler) *LimitHandler

NewLimitHandler creates a new instance of the LimitHandler for the given parameters.

func (*LimitHandler) ServeHTTP

func (l *LimitHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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