mux

package
v0.0.0-...-6dbf283 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(ens ...Engine)

func Start

func Start(router *Router, port int) error

Types

type Context

type Context struct {
	Writer  http.ResponseWriter
	Request *http.Request
	Params  map[string]interface{}
}

func (*Context) Json

func (p *Context) Json(val interface{})

func (*Context) Xml

func (p *Context) Xml(val interface{})

type Engine

type Engine interface {
	Mount(*Router)
}

type Handler

type Handler func(*Context) (int, error)

type Middleware

type Middleware func(Handler) Handler

type Route

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

func (*Route) Match

func (p *Route) Match(req *http.Request) bool

func (*Route) Parse

func (p *Route) Parse(req *http.Request) map[string]interface{}

type Router

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

func New

func New() *Router

func (*Router) Add

func (p *Router) Add(method, pattern string, middlewares []Middleware, handlers ...Handler)

func (*Router) Delete

func (p *Router) Delete(pattern string, middlewares []Middleware, handlers ...Handler)

func (*Router) Get

func (p *Router) Get(pattern string, middlewares []Middleware, handlers ...Handler)

func (*Router) Patch

func (p *Router) Patch(pattern string, middlewares []Middleware, handlers ...Handler)

func (*Router) Post

func (p *Router) Post(pattern string, middlewares []Middleware, handlers ...Handler)

func (*Router) Put

func (p *Router) Put(pattern string, middlewares []Middleware, handlers ...Handler)

func (*Router) ServeHTTP

func (p *Router) ServeHTTP(wrt http.ResponseWriter, req *http.Request)

func (*Router) Use

func (p *Router) Use(ms ...Middleware)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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