router

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handle

type Handle func(w http.ResponseWriter, r *http.Request, params map[string]string)

type Router

type Router struct {
	NotFound     http.HandlerFunc
	PanicHandler func(http.ResponseWriter, *http.Request, interface{})
	// contains filtered or unexported fields
}

func New

func New() *Router

func (*Router) AddValidate

func (router *Router) AddValidate(name string, validate Validate)

func (*Router) Handle

func (router *Router) Handle(method string, path string, handle Handle)

func (*Router) ServeHTTP

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

ServeHTTP implements the http.Handler interface.

type Validate

type Validate func(s string) (ok bool)

Jump to

Keyboard shortcuts

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