router

package
v0.0.0-...-706ea71 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 2 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(http.ResponseWriter, *http.Request, Params)

Handle is a function that can be registered to a route to handle HTTP requests.

type Params

type Params httprouter.Params

Param is a URL parameter

func (Params) ByName

func (ps Params) ByName(name string) string

ByName returns the value of the first Param which key matches the given name.

type Router

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

func New

func New() *Router

func (*Router) DELETE

func (r *Router) DELETE(path string, handle Handle)

func (*Router) GET

func (r *Router) GET(path string, handle Handle)

func (*Router) HEAD

func (r *Router) HEAD(path string, handle Handle)

func (*Router) Handle

func (r *Router) Handle(path string, handle Handle)

func (*Router) OPTIONS

func (r *Router) OPTIONS(path string, handle Handle)

func (*Router) PATCH

func (r *Router) PATCH(path string, handle Handle)

func (*Router) POST

func (r *Router) POST(path string, handle Handle)

func (*Router) PUT

func (r *Router) PUT(path string, handle Handle)

func (*Router) ServeHTTP

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

Jump to

Keyboard shortcuts

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