Documentation ¶
Overview ¶
A parser for tab indented trees of structured data.
Doc := { Elem | \n | Comment } Elem := N*\t Key [ \t Value ] \n { (N+1)*\t Elem \n } Comment := { \t } CommentPfx \n
Whitespace surrounding a Key/Value pair will be stripped. The comment prefix can be configured.
Index ¶
- type Config
- type Deferred
- type DeferredWorkRunner
- type Elem
- func (e Elem) Decode(i interface{}, c *Config) (err error)
- func (e *Elem) JoinSubElems(initialIndent, indent, sep string) string
- func (e Elem) Key() (key string)
- func (el *Elem) Lookup(key string) (i int, e *Elem)
- func (el *Elem) MapChildren() (m map[string]*Elem, err error)
- func (el *Elem) Match(key string) bool
- func (e *Elem) String() string
- func (e Elem) Value() (val string)
- type Error
- type Postprocessor
- type Reader
- type StructPreprocessor
- type UnmarshalTypeError
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeferredWorkRunner ¶
type Elem ¶
func (*Elem) JoinSubElems ¶
func (*Elem) Lookup ¶
Find the first occurance of ‘key’ in the list of childs, on success, return the corresponding slice index and a pointer to the Elem. Otherwise, return nil.
func (*Elem) MapChildren ¶
Create a map from an Elem's slice of children. Each key of a child will be used as a key into the map, a pointer to the child's Elem as value.
type Postprocessor ¶
type Postprocessor interface {
Postprocess() error
}
type Reader ¶
type StructPreprocessor ¶
type UnmarshalTypeError ¶
type UnmarshalTypeError struct { Value string // description of tidata value - "bool", "array", "number -5" Type reflect.Type // type of Go value it could not be assigned to }
An UnmarshalTypeError describes a tidata value that was not appropriate for a value of a specific Go type.
func (*UnmarshalTypeError) Error ¶
func (e *UnmarshalTypeError) Error() string
type Unmarshaler ¶
Click to show internal directories.
Click to hide internal directories.