package toml
import "github.com/pelletier/go-toml"
TOML markup language parser.
This version supports the specification as described in https://github.com/mojombo/toml/tree/e3656ad493400895f4460f1244a25f8f8e31a32a
Index ¶
- type TomlTree
- func Load(content string) (tree *TomlTree, err error)
- func LoadFile(path string) (tree *TomlTree, err error)
- func (t *TomlTree) Get(key string) interface{}
- func (t *TomlTree) GetDefault(key string, def interface{}) interface{}
- func (t *TomlTree) Keys() []string
- func (t *TomlTree) Set(key string, value interface{})
Types ¶
type TomlTree ¶
type TomlTree map[string]interface{}
Definition of a TomlTree. This is the result of the parsing of a TOML file.
func Load ¶
Create a TomlTree from a string.
func LoadFile ¶
Create a TomlTree from a file.
func (*TomlTree) Get ¶
Get the value at key in the TomlTree. Key is a dot-separated path (e.g. a.b.c). Returns nil if the path does not exist in the tree.
func (*TomlTree) GetDefault ¶
Same as Get but with a default value
func (*TomlTree) Keys ¶
Keys returns the keys of the toplevel tree. Warning: this is a costly operation.
func (*TomlTree) Set ¶
Set an element in the tree. Key is a dot-separated path (e.g. a.b.c). Creates all necessary intermediates trees, if needed.
Source Files ¶
- Version
- v0.1.0
- Published
- Jul 1, 2013
- Platform
- darwin/amd64
- Imports
- 10 packages
- Last checked
- 1 day ago –
Tools for package owners.