Documentation ¶
Index ¶
- type Parser
- type StateFn
- type Tree
- func (t *Tree) Get(key string) interface{}
- func (t *Tree) GetPath(keys []string) interface{}
- func (t *Tree) Has(key string) bool
- func (t *Tree) HasPath(keys []string) bool
- func (t *Tree) Keys() []string
- func (t *Tree) Set(key string, value interface{})
- func (t *Tree) SetPath(keys []string, value interface{})
- func (t *Tree) SetPathWithOptions(keys []string, value interface{}, multiline bool)
- func (t *Tree) SetWithOptions(key string, value interface{}, multiline bool)
- func (t *Tree) Write(w io.Writer, indent, keyspace string, bytesCount int64, ...) (int64, error)
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StateFn ¶
type StateFn func() StateFn
StateFn represents the state of the parser as a function that returns the next state.
type Tree ¶
type Tree struct { Values map[string]interface{} // string -> *Value, *Tree, []*Tree, comments Position lexer.Position }
Tree is the result of the parsing of a SAN file.
func (*Tree) Get ¶
Get the value at key in the Tree. Key is a dot-separated path (e.g. a.b.c) without single/double quoted strings. If you need to retrieve non-bare keys, use GetPath. Returns nil if the path does not exist in the tree. If keys is of length zero, the current tree is returned.
func (*Tree) GetPath ¶
GetPath returns the element in the tree indicated by 'keys'. If keys is of length zero, the current tree is returned.
func (*Tree) Set ¶
Set an element in the tree. Key is a dot-separated path (e.g. a.b.c). Creates all necessary intermediate trees, if needed.
func (*Tree) SetPathWithOptions ¶
SetPathWithOptions is the same as SetPath, but allows you to provide formatting instructions to the key, that will be reused by Marshal().
func (*Tree) SetWithOptions ¶
SetWithOptions is the same as Set, but allows you to provide formatting instructions to the key, that will be used by Marshal().