router

package
v0.0.0-...-b76ee76 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package router combines routing and middleware handling in a single package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chain

func Chain(c ...alice.Constructor) []alice.Constructor

Chain returns an array of middleware.

func ChainHandler

func ChainHandler(h http.Handler, c ...alice.Constructor) http.Handler

ChainHandler returns a handler of chained middleware.

func Delete

func Delete(path string, fn http.HandlerFunc, c ...alice.Constructor)

Delete is a shortcut for router.Handle("DELETE", path, handle).

func Get

func Get(path string, fn http.HandlerFunc, c ...alice.Constructor)

Get is a shortcut for router.Handle("GET", path, handle).

func Instance

func Instance() *vestigo.Router

Instance returns the router.

func MethodNotAllowed

func MethodNotAllowed(fn vestigo.MethodNotAllowedHandlerFunc)

MethodNotAllowed sets the 405 handler.

func NotFound

func NotFound(fn http.HandlerFunc)

NotFound sets the 404 handler.

func Patch

func Patch(path string, fn http.HandlerFunc, c ...alice.Constructor)

Patch is a shortcut for router.Handle("PATCH", path, handle).

func Post

func Post(path string, fn http.HandlerFunc, c ...alice.Constructor)

Post is a shortcut for router.Handle("POST", path, handle).

func Put

func Put(path string, fn http.HandlerFunc, c ...alice.Constructor)

Put is a shortcut for router.Handle("PUT", path, handle).

func ResetConfig

func ResetConfig()

ResetConfig creates a new instance.

func RouteList

func RouteList() []string

RouteList returns a list of the HTTP methods and paths.

Types

This section is empty.

Jump to

Keyboard shortcuts

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