router

package
v0.0.0-...-9c73dfc Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteError

func WriteError(w http.ResponseWriter, code int, err string)

func WriteJSON

func WriteJSON(w http.ResponseWriter, v interface{}) error

Types

type Handle

type Handle func(http.ResponseWriter, *http.Request, Params)

type Middleware

type Middleware func(http.Handler) http.Handler

type Params

type Params map[string]string

type Router

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

func New

func New() *Router

func (*Router) AddRoute

func (r *Router) AddRoute(m, p string, fn Handle)

func (*Router) GetRouter

func (r *Router) GetRouter() *httprouter.Router

func (*Router) Run

func (r *Router) Run(address string) error

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Router) Use

func (r *Router) Use(middleware ...Middleware)

Jump to

Keyboard shortcuts

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