Versions in this module Expand all Collapse all v1 v1.0.11 Jul 19, 2020 v1.0.10 Jul 19, 2020 Changes in this version + const ParamStart + const WildcardParamStart + var Charset = "utf-8" + var DefaultKeysSorter = func(list []string) func(i, j int) bool + var JSON = &jsonProcessor + var NoContentHandler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ... }) + var XML = &xmlProcessor + func Bind(r *http.Request, b Binder, ptrOut interface{}) error + func Dispatch(w http.ResponseWriter, d Dispatcher, v interface{}) error + func GetParam(w http.ResponseWriter, key string) string + func SetParam(w http.ResponseWriter, key, value string) bool + func TypeByExtension(ext string) (typ string) + func TypeByFilename(fullFilename string) string + type Binder interface + Bind func(*http.Request, interface{}) error + type Dispatcher interface + Dispatch func(http.ResponseWriter, interface{}) error + type Host string + func (h Host) Match(r *http.Request) bool + type InsertOption func(*Node) + func WithData(data interface{}) InsertOption + func WithHandler(handler http.Handler) InsertOption + func WithTag(tag string) InsertOption + type Matcher interface + Match func(*http.Request) bool + type MatcherFunc func(*http.Request) bool + func (fn MatcherFunc) Match(r *http.Request) bool + type MethodHandler struct + func Methods() *MethodHandler + func (m *MethodHandler) Handle(method string, handler http.Handler) *MethodHandler + func (m *MethodHandler) HandleFunc(method string, handlerFunc func(w http.ResponseWriter, r *http.Request)) *MethodHandler + func (m *MethodHandler) NoContent(methods ...string) *MethodHandler + func (m *MethodHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type Mux struct + PathCorrection bool + PathCorrectionNoRedirect bool + Routes *Trie + func NewMux() *Mux + func (m *Mux) AbsPath() string + func (m *Mux) AddRequestHandler(requestHandler RequestHandler) + func (m *Mux) Handle(pattern string, handler http.Handler) + func (m *Mux) HandleFunc(pattern string, handlerFunc func(http.ResponseWriter, *http.Request)) + func (m *Mux) HandleRequest(matcher Matcher, handler http.Handler) + func (m *Mux) Of(prefix string) SubMux + func (m *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (m *Mux) Unlink() SubMux + func (m *Mux) Use(middlewares ...Wrapper) + type Node struct + Data interface{} + Handler http.Handler + Tag string + func NewNode() *Node + func (n *Node) IsEnd() bool + func (n *Node) Keys(sorter NodeKeysSorter) (list []string) + func (n *Node) Parent() *Node + func (n *Node) String() string + type NodeKeysSorter = func(list []string) func(i, j int) bool + type ParamEntry struct + Key string + Value string + func GetParams(w http.ResponseWriter) []ParamEntry + type ParamsSetter interface + Set func(string, string) + type Processor interface + type RequestHandler interface + type ResponseWriter interface + Get func(string) string + GetAll func() []ParamEntry + type SubMux interface + AbsPath func() string + Handle func(pattern string, handler http.Handler) + HandleFunc func(pattern string, handlerFunc func(http.ResponseWriter, *http.Request)) + Of func(prefix string) SubMux + Unlink func() SubMux + Use func(middlewares ...Wrapper) + type Trie struct + func NewTrie() *Trie + func (t *Trie) Autocomplete(prefix string, sorter NodeKeysSorter) (list []string) + func (t *Trie) HasPrefix(prefix string) bool + func (t *Trie) Insert(pattern string, options ...InsertOption) + func (t *Trie) Parents(prefix string) (parents []*Node) + func (t *Trie) Search(q string, params ParamsSetter) *Node + func (t *Trie) SearchPrefix(prefix string) *Node + type Wrapper func(http.Handler) http.Handler + type Wrappers []Wrapper + func Pre(middleware ...Wrapper) Wrappers + func (w Wrappers) For(main http.Handler) http.Handler + func (w Wrappers) ForFunc(mainFunc func(http.ResponseWriter, *http.Request)) http.Handler