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
func (t *TrustOnFirstConnect) Tofc(next http.HandlerFunc) http.HandlerFunc
Tofc wraps a given handler to be onlyaccessible by the first n clients.
Click to show internal directories.
Click to hide internal directories.