router

package
v0.0.0-...-5254df5 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 8 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 {
	Req *http.Request
	Out http.ResponseWriter

	Vars map[string]string
	// contains filtered or unexported fields
}

func (*Context) HTML

func (c *Context) HTML(status int, tmpl *template.Template, data interface{})

func (*Context) JSON

func (c *Context) JSON(status int, data interface{})

func (*Context) Next

func (c *Context) Next()

func (*Context) QueryInt64

func (c *Context) QueryInt64(key string) (int64, error)

func (*Context) Redirect

func (c *Context) Redirect(url string)

func (*Context) VarInt64

func (c *Context) VarInt64(key string) (int64, error)

type Handler

type Handler func(*Context)

type Route

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

type Router

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

func NewRouter

func NewRouter(base string) *Router

func (*Router) For

func (r *Router) For(path string, handler Handler)

func (*Router) ServeHTTP

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

func (*Router) Use

func (r *Router) Use(h Handler)

Jump to

Keyboard shortcuts

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