handler

package
v0.0.0-...-66cff79 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionHeader = "Authorization-Session"
	TokenHeader   = "Authorization-Token"
)

Variables

This section is empty.

Functions

func CurrentSession

func CurrentSession(r *http.Request) *session.Session

CurrentSession returns the matched session for the current request, if any.

func CurrentToken

func CurrentToken(r *http.Request) *session.Session

CurrentToken returns the matched token for the current request, if any.

func DebugHandle

func DebugHandle(h http.Handler) http.Handler

DebugHandle

func LogHandler

func LogHandler(h http.Handler) http.Handler

LogHandler adds logging to http requests

func MeasureHandler

func MeasureHandler(h http.Handler) http.Handler

MeasureHandler adds measuring to http requests

func NewAuthSessionHandler

func NewAuthSessionHandler(sessionStorage session.Storage, must bool) func(http.Handler) http.Handler

NewAuthSessionHandler creates a AuthSessionHandler for the specified backend. It loads a session from a session key.

func NewAuthTokenHandler

func NewAuthTokenHandler(tokenStorage session.Storage) func(http.Handler) http.Handler

NewAuthTokenHandler creates a AuthTokenHandler for the specified It loads a session from a token key.

func NewCORSHandler

func NewCORSHandler(domains ...string) func(h http.Handler) http.Handler

LogHandler adds logging to http requests

func RecoveryHandler

func RecoveryHandler(h http.Handler) http.Handler

func Use

func Use(handler http.Handler, middleware ...func(http.Handler) http.Handler) http.Handler

Creates a stack of HTTP handlers. Each HTTP handler is responsible for calling the next. The handlers are executed in reverse order, the last is called first.

Types

This section is empty.

Jump to

Keyboard shortcuts

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