handler

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LimitRequests

func LimitRequests(id string, maxRequests int, other http.HandlerFunc) http.HandlerFunc

LimitRequests allows at most maxRequests to an endpoint

func ServeFile

func ServeFile(file string, inline bool) http.HandlerFunc

ServeFile serves the specified file over http

func ServeUploadPage added in v1.2.0

func ServeUploadPage(destinationDir string) http.HandlerFunc

Receive files over http form

Types

type TrustOnFirstConnect added in v1.1.0

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

TrustOnFirstConnect is a middleware that only allows the first n clients to connect. Zero value is not usable.

func NewTrustOnFirstConnect added in v1.1.0

func NewTrustOnFirstConnect(maxClients int) *TrustOnFirstConnect

NewTrustOnFirstConnect creates a new TrustOnFirstConnect

func (*TrustOnFirstConnect) Tofc added in v1.1.0

Tofc wraps a given handler to be onlyaccessible by the first n clients.

Jump to

Keyboard shortcuts

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