router

package
v0.0.0-...-27c6690 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index

func Index(w http.ResponseWriter, r *http.Request)

Index default index handler

func Logger

func Logger(inner http.Handler, name string) http.Handler

Logger wraps request handler and log info about requests.

func NewRouter

func NewRouter(routes Routes) *mux.Router

NewRouter create a router with desired routers.

func NotFound

func NotFound(w http.ResponseWriter, r *http.Request)

NotFound default handler for undefined routes.

Types

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route struct

type Routes

type Routes []Route

Jump to

Keyboard shortcuts

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