mux

package
v0.0.0-...-b88123c Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Writer  http.ResponseWriter
	Request *http.Request
	Params  httprouter.Params

	Token string
	Data  map[string]interface{}
	// contains filtered or unexported fields
}

func (*Context) AddFlash

func (c *Context) AddFlash(msg string)

func (*Context) DeleteToken

func (c *Context) DeleteToken()

func (*Context) GetFlashes

func (c *Context) GetFlashes() []string

func (*Context) Redirect

func (c *Context) Redirect(paths ...string)

func (*Context) SaveFlash

func (c *Context) SaveFlash()

func (*Context) SetToken

func (c *Context) SetToken(token string)

type Router

type Router struct {
	ErrorHandler func(c *Context, err error)
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter() *Router

func (*Router) GET

func (r *Router) GET(path string, handler func(c *Context) error)

func (*Router) POST

func (r *Router) POST(path string, handler func(c *Context) error)

func (*Router) ServeHTTP

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

Jump to

Keyboard shortcuts

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