router

package
v0.0.0-...-89dfdfc Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: MIT Imports: 14 Imported by: 0

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 NewGroup

func NewGroup(router *Router) *Group

func (*Group) Group

func (g *Group) Group(routes func(*Router))

type Request

type Request struct {
	*http.Request
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(r *http.Request) *Request

func (*Request) Body

func (r *Request) Body() any

func (*Request) Form

func (r *Request) Form() url.Values

func (*Request) Get

func (r *Request) Get(param string) interface{}

func (*Request) Params

func (r *Request) Params() *use.Collection[string, interface{}]

func (*Request) Query

func (r *Request) Query() url.Values

func (*Request) RouteParams

func (r *Request) RouteParams() httprouter.Params

func (*Request) Validate

func (r *Request) Validate(rules map[string]interface{}) validation.Validator

func (*Request) ValidateStruct

func (r *Request) ValidateStruct(s interface{}) validation.Validator

type Router

type Router struct {
	Fs embed.FS
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter() *Router

func (*Router) AddMiddleware

func (r *Router) AddMiddleware(middleware middleware.Middleware) *Router

func (*Router) Any

func (r *Router) Any(path string, handler interface{})

func (*Router) Connect

func (r *Router) Connect(path string, handler interface{})

func (*Router) Delete

func (r *Router) Delete(path string, handler interface{})

func (*Router) File

func (r *Router) File(path string, file string)

func (*Router) Get

func (r *Router) Get(path string, handler interface{})

func (*Router) Head

func (r *Router) Head(path string, handler interface{})

func (*Router) Match

func (r *Router) Match(path string, handler interface{}, httpMethods ...string)

func (*Router) MethodTable

func (r *Router) MethodTable() map[string]func(path string, handler interface{})

func (*Router) Middleware

func (r *Router) Middleware(middlewares ...middleware.Middleware) *Group

func (*Router) Options

func (r *Router) Options(path string, handler interface{})

func (*Router) Patch

func (r *Router) Patch(path string, handler interface{})

func (*Router) Post

func (r *Router) Post(path string, handler interface{})

func (*Router) Prefix

func (r *Router) Prefix(prefix string) *Group

func (*Router) Put

func (r *Router) Put(path string, handler interface{})

func (*Router) ServeFiles

func (r *Router) ServeFiles(path string, fs http.FileSystem)

func (*Router) ServeHTTP

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

func (*Router) Static

func (r *Router) Static(path string, rootDir string)

func (*Router) Trace

func (r *Router) Trace(path string, handler interface{})

Jump to

Keyboard shortcuts

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