router

package
v0.0.0-...-37a2e4e Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 5 Imported by: 4

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(mdlw ...Middleware)

type HandlerFunc

type HandlerFunc func(*context.Context) error

type Middleware

type Middleware func(HandlerFunc) HandlerFunc

type Router

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

func New

func New(rrt context.RendererType) *Router

func (*Router) NewSubRouter

func (r *Router) NewSubRouter(prefix string, rrt context.RendererType) (*SubRouter, error)

func (*Router) ServeHTTP

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

type SubRouter

type SubRouter struct {
	OnNotFound HandlerFunc
	// contains filtered or unexported fields
}

func (*SubRouter) Add

func (sr *SubRouter) Add(method, path string, handler HandlerFunc)

func (*SubRouter) Any

func (sr *SubRouter) Any(path string, handler HandlerFunc)

func (*SubRouter) Delete

func (sr *SubRouter) Delete(path string, handler HandlerFunc)

func (*SubRouter) Get

func (sr *SubRouter) Get(path string, handler HandlerFunc)

func (*SubRouter) Group

func (sr *SubRouter) Group(path string, fn func(*Group))

func (*SubRouter) Head

func (sr *SubRouter) Head(path string, handler HandlerFunc)

func (*SubRouter) Options

func (sr *SubRouter) Options(path string, handler HandlerFunc)

func (*SubRouter) Patch

func (sr *SubRouter) Patch(path string, handler HandlerFunc)

func (*SubRouter) Post

func (sr *SubRouter) Post(path string, handler HandlerFunc)

func (*SubRouter) Put

func (sr *SubRouter) Put(path string, handler HandlerFunc)

func (*SubRouter) ServeFiles

func (sr *SubRouter) ServeFiles(path string, fs http.FileSystem) error

func (*SubRouter) ServeHTTP

func (sr *SubRouter) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*SubRouter) Use

func (sr *SubRouter) Use(mdlw ...Middleware)

Jump to

Keyboard shortcuts

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