tree

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const PathDelimiter = "/"
View Source
const VarPrefix = ":"
View Source
const Wildcard = "*"

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(w http.ResponseWriter, r *http.Request, params map[string]string)

type TreeNode

type TreeNode struct {
	Handler map[string]Handler
	Childs  map[string]*TreeNode
	VarName string
	Parent  *TreeNode `json:"-"`
	// contains filtered or unexported fields
}

func NewTree

func NewTree() *TreeNode

func (*TreeNode) AddNode

func (t *TreeNode) AddNode(path string, method string, handler Handler)

func (*TreeNode) Dump

func (t *TreeNode) Dump() string

func (TreeNode) GetNode

func (t TreeNode) GetNode(path, method string) (Handler, map[string]string)

func (*TreeNode) Mount

func (t *TreeNode) Mount(path string, tree *TreeNode)

func (*TreeNode) RemoveNode

func (t *TreeNode) RemoveNode(path string)

Jump to

Keyboard shortcuts

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