router

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessParams

func ProcessParams(req *http.Request, params map[string]string)

Types

type Route

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

func (*Route) Match

func (self *Route) Match(r *http.Request) map[string]string

type Router

type Router struct {
	/* This is the template for error pages */
	Fallback template.Template

	/* StaticPaths can be filled from outside when constructing the Router.
	 * key = uri
	 * value = file path
	 */
	StaticPaths map[string]string
	// contains filtered or unexported fields
}

func (*Router) AddRoute

func (self *Router) AddRoute(method string, path string, h http.Handler)

func (*Router) Delete

func (self *Router) Delete(path string, h http.Handler)

func (*Router) ErrorPage

func (self *Router) ErrorPage(w http.ResponseWriter, req *http.Request, code int, errMsg string)

func (*Router) Get

func (self *Router) Get(path string, h http.Handler)

func (*Router) Post

func (self *Router) Post(path string, h http.Handler)

func (*Router) Put

func (self *Router) Put(path string, h http.Handler)

func (*Router) ServeHTTP

func (self *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