route

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NilParams = &Params{}

Functions

func SetRequestParams

func SetRequestParams(c *fasthttp.RequestCtx, params *Params)

Types

type Params

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

func RequestParams

func RequestParams(c *fasthttp.RequestCtx) *Params

func (*Params) Get

func (p *Params) Get(key string) (val string, ok bool)

func (*Params) Reset

func (p *Params) Reset()

func (*Params) Valid

func (p *Params) Valid() bool

func (*Params) Value

func (p *Params) Value(idx int) string

type Route

type Route struct {
	Params  []string
	Handler func(c *fasthttp.RequestCtx) error
}

type Router

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

func (*Router) Add

func (r *Router) Add(method string, path string, fn func(*Route) error) error

func (*Router) Clear

func (r *Router) Clear()

func (*Router) Lookup

func (r *Router) Lookup(method []byte, p []byte) (cb func(c *fasthttp.RequestCtx) error, params *Params, ok bool)

func (*Router) LookupString

func (r *Router) LookupString(method string, path string) (cb func(c *fasthttp.RequestCtx) error, params *Params, ok bool)

func (*Router) ReleaseParams

func (r *Router) ReleaseParams(p *Params)

Jump to

Keyboard shortcuts

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