middleware

package
v0.0.0-...-e0e2f15 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(handler http.Handler) (http.Handler, func(Middlewarer))

Types

type Cors

type Cors struct {
	Origins set
	Middleware

	Headers     []string
	Methods     []string
	Credentials bool
}

func NewCors

func NewCors(origins ...string) *Cors

func (*Cors) ServeHTTP

func (m *Cors) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Middleware

type Middleware struct {
	http.Handler
}

Middleware can be embedded in an object to automatically implement the Middlewarer interface

func (*Middleware) Next

func (m *Middleware) Next(handler http.Handler)

Sets the next handler for this middleware. This could be a

type Middlewarer

type Middlewarer interface {
	ServeHTTP(http.ResponseWriter, *http.Request)
	Next(http.Handler)
}

type RequestLogger

type RequestLogger struct {
	Middleware
}

func (*RequestLogger) ServeHTTP

func (m *RequestLogger) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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