Documentation ¶
Index ¶
- type Node
- type Trie
- func (trie *Trie) Clear() bool
- func (trie Trie) Contains(withOutHost string) (bool, error)
- func (trie Trie) Get(withOutHost string) (*Node, []string, bool, error)
- func (trie *Trie) IsEmpty() bool
- func (trie Trie) Match(withOutHost string) (*Node, []string, bool)
- func (trie *Trie) Put(withOutHost string, bizInfo interface{}) (bool, error)
- func (trie *Trie) PutOrUpdate(withOutHost string, bizInfo interface{}) (bool, error)
- func (trie Trie) Remove(withOutHost string) (*Node, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { PathVariablesSet map[string]*Node // in path /:a/b/c/:d , :a is a path variable node of level1 , :d is path variable node of level4 PathVariableNode *Node // in path /:a/b/c/:d , /b/c/:d is a child tree of pathVariable node :a ,and some special logic for match pathVariable it better not store in children. MatchAllNode *Node // /a/b/** /** is a match all Node. // contains filtered or unexported fields }
Node
type Trie ¶
type Trie struct {
// contains filtered or unexported fields
}
Trie
func NewTrieWithDefault ¶
NewTrieWithDefault
func (Trie) Match ¶
Match get values according url , pathVariable supported. returns: *Node this node in path, if not exists return nil []string reversed array of pathVariable value /valA/valB/valC matchs /:aa/:bb/:cc returns array of (valC,valB,valA) bool is ok error
func (*Trie) PutOrUpdate ¶
Put put key and values into trie as map.
Click to show internal directories.
Click to hide internal directories.