router

package module
v0.0.0-...-1459f3d Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 5 Imported by: 2

README

router

A FAIRE.

Licence

MIT.


Copyright (c) 2021 losyme.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

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

func (*Group) Add

func (g *Group) Add(method, path string, handler HandlerFunc)

func (*Group) Any

func (g *Group) Any(path string, handler HandlerFunc)

func (*Group) Delete

func (g *Group) Delete(path string, handler HandlerFunc)

func (*Group) Get

func (g *Group) Get(path string, handler HandlerFunc)

func (*Group) Head

func (g *Group) Head(path string, handler HandlerFunc)

func (*Group) New

func (g *Group) New(path string, fn func(*Group))

func (*Group) Options

func (g *Group) Options(path string, handler HandlerFunc)

func (*Group) Patch

func (g *Group) Patch(path string, handler HandlerFunc)

func (*Group) Post

func (g *Group) Post(path string, handler HandlerFunc)

func (*Group) Put

func (g *Group) Put(path string, handler HandlerFunc)

func (*Group) Use

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

type HandlerFunc

type HandlerFunc func(*context.Context) error

type Middleware

type Middleware func(HandlerFunc) HandlerFunc

type Router

type Router struct {
	NotFound         HandlerFunc
	MethodNotAllowed HandlerFunc
	OnRecover        HandlerFunc
	OnError          HandlerFunc
	// contains filtered or unexported fields
}

func New

func New() *Router

func (*Router) Add

func (r *Router) Add(method, path string, handler HandlerFunc)

func (*Router) Any

func (r *Router) Any(path string, handler HandlerFunc)

func (*Router) Delete

func (r *Router) Delete(path string, handler HandlerFunc)

func (*Router) Get

func (r *Router) Get(path string, handler HandlerFunc)

func (*Router) Group

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

func (*Router) Head

func (r *Router) Head(path string, handler HandlerFunc)

func (*Router) Options

func (r *Router) Options(path string, handler HandlerFunc)

func (*Router) Patch

func (r *Router) Patch(path string, handler HandlerFunc)

func (*Router) Post

func (r *Router) Post(path string, handler HandlerFunc)

func (*Router) Put

func (r *Router) Put(path string, handler HandlerFunc)

func (*Router) ServeHTTP

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

func (*Router) Use

func (r *Router) Use(mdls ...Middleware)

Jump to

Keyboard shortcuts

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