middlewares

package
v0.0.0-...-11af2ba Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessLog

func AccessLog(l *log.Logger) func(web.Handler) web.Handler

AccessLog is a middleware that prints request access logs to a log.Logger of your choice. If *log.Logger is nil, a panic will be raised.

Columns for each output line: Host Remote client addr HTTP request (method, path, protocol) HTTP response code Response body size (in kb) Response run time HTTP Referer Client User-Agent

func BasicAuth

func BasicAuth(username, password string) func(web.Handler) web.Handler

BasicAuth is a middleware that checks requests for the HTTP Basic Auth header and securely validates it against the given user/password pair.

Types

This section is empty.

Jump to

Keyboard shortcuts

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