Documentation
¶
Overview ¶
Package ini provides INI file read functionality in Go.
File:
foo=bar [db] user=myuser password=mypassword
Code:
conf, err := ini.LoadFromFile("my/file/path.conf")
fmt.Printf("%v\n", conf)
Output:
map[default:map[foo:bar] db:map[user:myuser password:mypassword]]
Index ¶
- func LoadFromFile(filename string) (map[string]map[string]string, error)
- func LoadFromFileFlat(filename string) (map[string]string, error)
- func LoadFromReader(r io.Reader) (map[string]map[string]string, error)
- func LoadFromReaderFlat(r io.Reader) (map[string]string, error)
- func LoadFromString(buf string) (map[string]map[string]string, error)
- func LoadFromStringFlat(buf string) (map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFromFile ¶
LoadFromFile parses and INI file, returning a map of sections, where each section is another map.
func LoadFromFileFlat ¶
Like LoadFromFile, except it flattens the data structure into a single map, with section names prepended to field names, delimited by a period.
func LoadFromReader ¶
LoadFromReader is like LoadFromFile, except that it reads from an io.Reader interface.
func LoadFromReaderFlat ¶
Like LoadFromReader, it except flattens the data structure into a single map, with section names prepended to field names, delimited by a period.
func LoadFromString ¶
Like ReadFromFile, except that it parses a string containing the full INI contents.
Types ¶
This section is empty.