router

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

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParamByName

func GetParamByName(params *httprouter.Params, name string) (string, error)

GetParamByName returns the value of the named parameter, and an error if it does not exist.

func GetParams

func GetParams(r *http.Request) httprouter.Params

GetParams returns parameters from the request context.

func GetURLParamByName

func GetURLParamByName(params *url.Values, name string) (string, error)

GetURLParamByName returns the value of the named parameter, and an error if it does not exist.

func GetURLParams

func GetURLParams(r *http.Request) url.Values

GetURLParams returns parameters in the url.

Types

type Router

type Router struct {
	*httprouter.Router
}

Router wraps a Go router implementation

func New

func New() *Router

New returns a new wrapped router instance.

func (*Router) Get

func (r *Router) Get(path string, handler http.Handler)

Get adds a GET route to the router.

func (*Router) Post

func (r *Router) Post(path string, handler http.Handler)

Post adds a POST route to the router.

Jump to

Keyboard shortcuts

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