middleware

package module
v0.0.0-...-56a0a68 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2016 License: MIT Imports: 5 Imported by: 0

README

Go Report Card

middleware

A collection of useful handlers for Go's net/http package.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthUserHandler

func AuthUserHandler(store *sessions.FilesystemStore, sessionName string) func(http.Handler) http.Handler

AuthUserHandler ...

func DomainHandler

func DomainHandler(allowedDomain string) func(http.Handler) http.Handler

DomainHandler ...

func Handler

func Handler(h http.Handler) http.Handler

Handler ...

func LoggerHandler

func LoggerHandler(h http.Handler) http.Handler

LoggerHandler ...

Types

type HostSwitch

type HostSwitch map[string]http.Handler

func New

func New() HostSwitch

func (HostSwitch) ServeHTTP

func (hs HostSwitch) ServeHTTP(w http.ResponseWriter, r *http.Request)

Implement the ServerHTTP method

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger ...

func NewLogger

func NewLogger(h http.Handler) *Logger

NewLogger ...

func (*Logger) ServeHTTP

func (l *Logger) ServeHTTP(w http.ResponseWriter, r *http.Request)

Any struct with the method ServeHTTP(http.ResponseWriter, *http.Request) will be implementing http.Handler and will be usable with the Go muxer (http.Handle(pattern, handler) function).

Jump to

Keyboard shortcuts

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