Documentation
¶
Overview ¶
Package mux provide route tree
Index ¶
- type Node
- func (n *Node) AddChild(ids []string) *Node
- func (n *Node) Children() *Tree
- func (n *Node) GetChild(ids []string) (*Node, context.Params)
- func (n *Node) GetChildByPath(path string) (*Node, context.Params, string)
- func (n *Node) ID() string
- func (n *Node) IsLeaf() bool
- func (n *Node) IsRoot() bool
- func (n *Node) IsSubrouter() bool
- func (n *Node) Route() Route
- func (n *Node) SetRegexp(exp string)
- func (n *Node) SetRoute(r Route)
- func (n *Node) TurnIntoSubrouter()
- type Route
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is route node
func (*Node) GetChildByPath ¶
GetChildByPath accepts string path then returns: child node as a first arg, parameters built from wildcards, and part of path (this is used to strip request path for sub routers)
func (*Node) IsSubrouter ¶
IsSubrouter returns true if node is subrouter
func (*Node) TurnIntoSubrouter ¶
func (n *Node) TurnIntoSubrouter()
TurnIntoSubrouter sets node as subrouter
type Route ¶
type Route interface {
Handler() interface{}
AppendMiddleware(m middleware.Middleware)
PrependMiddleware(m middleware.Middleware)
}
Route is an middleware aware route interface
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree of routes
func (*Tree) RegexpNodes ¶
RegexpNodes returns tree regexp nodes
func (*Tree) StaticNodes ¶
StaticNodes returns tree static nodes
func (*Tree) WildcardNode ¶
WildcardNode returns tree wildcard node
Click to show internal directories.
Click to hide internal directories.