Documentation
¶
Overview ¶
Package trie implements a simple trie data structure that maps "paths" (which are slices of strings) to arbitrary data values (type interface{}).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Trie ¶
type Trie struct { Entry interface{} SplatEntry interface{} // to match xxx.xxx.* Children trieChildren }
func (*Trie) Get ¶
Get retrieves an element from the Trie
Takes a path (which can be empty, to denote the root element of the Trie), and returns the object if the path exists in the Trie, or nil and a status of false. Example:
if res, ok := trie.Get([]string{"foo", "bar"}), ok { fmt.Println("Value at /foo/bar was", res) }
Click to show internal directories.
Click to hide internal directories.