mux

package
v0.0.0-...-00e0705 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Request *http.Request
	Writer  http.ResponseWriter
	// contains filtered or unexported fields
}

Context http context

func (*Context) Abort

func (p *Context) Abort(s int, e error)

Abort abort

func (*Context) BindForm

func (p *Context) BindForm(fm interface{}) error

BindForm bind form

func (*Context) BindJSON

func (p *Context) BindJSON(fm interface{}) error

BindJSON bind json

func (*Context) ClientIP

func (p *Context) ClientIP() string

ClientIP get remote client ip

func (*Context) Cookie

func (p *Context) Cookie(n string) string

Cookie get cookie value

func (*Context) FormFile

func (p *Context) FormFile(n string) (*multipart.FileHeader, error)

FormFile file upload

func (*Context) Header

func (p *Context) Header(n string) string

Header get header value

func (*Context) Home

func (p *Context) Home() string

Home home url

func (*Context) JSON

func (p *Context) JSON(s int, v interface{})

JSON render json

func (*Context) Locale

func (p *Context) Locale() string

Locale detect locale from http.Request, order by [query, cookie, header]

func (*Context) Param

func (p *Context) Param(n string) string

Param get param from url pattern

func (*Context) Query

func (p *Context) Query(n string) string

Query get query param

func (*Context) XML

func (p *Context) XML(s int, v interface{})

XML render xml

type H

type H map[string]interface{}

H hash

type HandlerFunc

type HandlerFunc func(*Context)

HandlerFunc http handler func

type Router

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

Router http router

func NewRouter

func NewRouter(o render.Options, m language.Matcher) *Router

NewRouter new router

func (*Router) DELETE

func (p *Router) DELETE(pat string, hnd HandlerFunc)

DELETE http DELETE

func (*Router) GET

func (p *Router) GET(pat string, hnd HandlerFunc)

GET http GET

func (*Router) Group

func (p *Router) Group(pat string) *Router

Group sub-router

func (*Router) Listen

func (p *Router) Listen(port int, debug bool, origins ...string) error

Listen listen

func (*Router) PATCH

func (p *Router) PATCH(pat string, hnd HandlerFunc)

PATCH http PATCH

func (*Router) POST

func (p *Router) POST(pat string, hnd HandlerFunc)

POST http POST

func (*Router) PUT

func (p *Router) PUT(pat string, hnd HandlerFunc)

PUT http PUT

func (*Router) Walk

func (p *Router) Walk(f func(methods []string, pattern string) error) error

Walk walk routes

Jump to

Keyboard shortcuts

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