middleware

package module
v0.0.0-...-ad12bc9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2016 License: Apache-2.0 Imports: 1 Imported by: 0

README

middleware

Documentation

Overview

Package middleware provides a simple middleware framework based on http.Handler and collects a few useful small middleware. It is heavily based on the concepts of justinas/alice but with a minimal API

Package middleware provide useful middleware in the form func(http.Handler) http.Handler In some cases, it re-packages functions in external packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain []MiddleWare

Chain is a list of middleware that are called in order

func New

func New(middleware ...MiddleWare) Chain

New creates a new middleware chain

func (Chain) Serve

func (chain Chain) Serve(h http.Handler) http.Handler

Serve wraps the provided handler in the middleware chain and returns a handler

type MiddleWare

type MiddleWare func(next http.Handler) http.Handler

MiddleWare is a function that takes a http.Handler and wraps your middleware around it. Call next.ServeHTTP() in your middleware if you want to continue the middleware chain or return without calling it to stop propagation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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