router

package
v0.0.0-...-cee7a81 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 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

This section is empty.

Types

type Item

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

Item implements the password hashing system.

func New

func New() *Item

New returns a new instance of the router.

func (*Item) Chain

func (s *Item) Chain(c ...alice.Constructor) []alice.Constructor

Chain returns an array of middleware.

func (*Item) ChainHandler

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

ChainHandler returns a handler of chained middleware.

func (*Item) Delete

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

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

func (*Item) Get

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

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

func (*Item) Param

func (s *Item) Param(r *http.Request, name string) string

Param returns the URL parameter.

func (*Item) Patch

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

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

func (*Item) Post

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

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

func (*Item) Put

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

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

func (*Item) RouteList

func (s *Item) RouteList() []string

RouteList returns a list of the HTTP methods and paths.

func (*Item) Router

func (s *Item) Router() *vestigo.Router

Router returns the router.

func (*Item) SetMethodNotAllowed

func (s *Item) SetMethodNotAllowed(fn vestigo.MethodNotAllowedHandlerFunc)

SetMethodNotAllowed sets the 405 handler.

func (*Item) SetNotFound

func (s *Item) SetNotFound(fn http.HandlerFunc)

SetNotFound sets the 404 handler.

Jump to

Keyboard shortcuts

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