Documentation
¶
Index ¶
- type Node
- type PrintOption
- type Tree
- func (t *Tree) Add(key, value, label string) error
- func (t *Tree) Contains(key string) bool
- func (t *Tree) Delete(key string) (string, error)
- func (t *Tree) Flatten() []*Node
- func (t *Tree) Fprint(w io.Writer)
- func (t *Tree) Get(key string) (string, error)
- func (t *Tree) SetPrefix(prefix string)
- func (t *Tree) String() string
- func (t *Tree) Update(key, value, label string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrintOption ¶
type PrintOption int
PrintOption determines what information about each Node is printed. The values of Key, Value, and Label were chosen to be relatively prime to make determining what combination of identifiers to print purely mathematical Actual output may vary depending on available identifiers for each Node.
const ( Key PrintOption = 2 Value PrintOption = 3 Label PrintOption = 5 KeyValue PrintOption = 6 KeyLabel PrintOption = 10 ValueLabel PrintOption = 15 KeyValueLabel PrintOption = 30 )
func (PrintOption) String ¶
func (po PrintOption) String() string
type Tree ¶
type Tree struct {
PrintOption PrintOption
// contains filtered or unexported fields
}
func (*Tree) Add ¶
Add adds the given Value to the tree at the given Key path. If interior nodes between the root and leaf do not exist, empty nodes without a Value are created along the path. Add cannot be used to overwrite a Value that already exists at the given Key path.
func (*Tree) Contains ¶
Contains returns true if Key is found in the tree, even if the Value is unset.
func (*Tree) Delete ¶
Delete deletes the Node identified by the given Key. Currently, only deleting leaves is supported.