ini

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2016 License: BSD-3-Clause Imports: 4 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFromFile

func LoadFromFile(filename string) (map[string]map[string]string, error)

LoadFromFile parses and INI file, returning a map of sections, where each section is another map.

func LoadFromFileFlat

func LoadFromFileFlat(filename string) (map[string]string, error)

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

func LoadFromReader(r io.Reader) (map[string]map[string]string, error)

LoadFromReader is like LoadFromFile, except that it reads from an io.Reader interface.

func LoadFromReaderFlat

func LoadFromReaderFlat(r io.Reader) (map[string]string, error)

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

func LoadFromString(buf string) (map[string]map[string]string, error)

Like ReadFromFile, except that it parses a string containing the full INI contents.

func LoadFromStringFlat

func LoadFromStringFlat(buf string) (map[string]string, error)

Like LoadFromString, it except flattens the data structure into a single map, with section names prepended to field names, delimited by a period.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL