middleware

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2020 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidToken is returned when the request token is invalid.
	ErrInvalidToken = errors.New("invalid or missing token")
)

Functions

func Cache

func Cache(next http.Handler) http.Handler

Cache writes required cache headers to all requests.

func Cors

func Cors(next http.Handler) http.Handler

Cors writes required cors headers to all requests.

func Logger

func Logger(logger log.Logger) func(http.Handler) http.Handler

Logger is a middleware to log http requests.

func OpenIDConnect added in v1.3.0

func OpenIDConnect(opts ...ocisoidc.Option) func(http.Handler) http.Handler

OpenIDConnect provides a middleware to check access secured by a static token.

func RealIP

func RealIP(next http.Handler) http.Handler

RealIP is a middleware that sets a http.Request RemoteAddr.

func RequestID

func RequestID(next http.Handler) http.Handler

RequestID is a convenient middleware to inject a request id.

func Secure

func Secure(next http.Handler) http.Handler

Secure writes required access headers to all requests.

func Static

func Static(root string, fs http.FileSystem) func(http.Handler) http.Handler

Static is a middleware that serves static assets.

func Token

func Token(token string) func(http.Handler) http.Handler

Token provides a middleware to check access secured by a static token.

func Version

func Version(name, version string) func(http.Handler) http.Handler

Version writes the current version to the headers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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