router

package module
v0.0.0-...-36b9b2b Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: MIT Imports: 3 Imported by: 0

README

router

A FAIRE.

Licence

MIT.


Copyright (c) 2021 losyme.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Param

func Param(req *http.Request, param string) string

Types

type Group

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

func (*Group) Any

func (g *Group) Any(path string, fn http.HandlerFunc)

func (*Group) Delete

func (g *Group) Delete(path string, fn http.HandlerFunc)

func (*Group) Get

func (g *Group) Get(path string, fn http.HandlerFunc)

func (*Group) Handler

func (g *Group) Handler(method, path string, handler http.Handler)

func (*Group) HandlerFunc

func (g *Group) HandlerFunc(method, path string, fn http.HandlerFunc)

func (*Group) Head

func (g *Group) Head(path string, fn http.HandlerFunc)

func (*Group) Options

func (g *Group) Options(path string, fn http.HandlerFunc)

func (*Group) Patch

func (g *Group) Patch(path string, fn http.HandlerFunc)

func (*Group) Post

func (g *Group) Post(path string, fn http.HandlerFunc)

func (*Group) Put

func (g *Group) Put(path string, fn http.HandlerFunc)

func (*Group) Use

func (g *Group) Use(middlewares ...Middleware)

type Middleware

type Middleware func(http.Handler) http.Handler

type Router

type Router struct {
	NotFound         http.Handler
	MethodNotAllowed http.Handler
	Panic            http.Handler
	// contains filtered or unexported fields
}

func New

func New() *Router

func (*Router) Any

func (r *Router) Any(path string, fn http.HandlerFunc)

func (*Router) Delete

func (r *Router) Delete(path string, fn http.HandlerFunc)

func (*Router) Get

func (r *Router) Get(path string, fn http.HandlerFunc)

func (*Router) Group

func (r *Router) Group(path string, fn func(*Group))

func (*Router) Handler

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

func (*Router) HandlerFunc

func (r *Router) HandlerFunc(method, path string, fn http.HandlerFunc)

func (*Router) Head

func (r *Router) Head(path string, fn http.HandlerFunc)

func (*Router) Options

func (r *Router) Options(path string, fn http.HandlerFunc)

func (*Router) Patch

func (r *Router) Patch(path string, fn http.HandlerFunc)

func (*Router) Post

func (r *Router) Post(path string, fn http.HandlerFunc)

func (*Router) Put

func (r *Router) Put(path string, fn http.HandlerFunc)

func (*Router) ServeHTTP

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

func (*Router) Use

func (r *Router) Use(path string, middlewares ...Middleware)

Jump to

Keyboard shortcuts

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