ini

package module
v0.0.0-...-a89f355 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: MIT Imports: 9 Imported by: 0

README

goini

INI file parser in go.

See Also

For real apps, you can use TOML instead, which is a better INI format :-)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(filename string, dict *Dict) error

Types

type Dict

type Dict map[string]map[string]string

func Load

func Load(filename string) (Dict, error)

func LoadReader

func LoadReader(reader *bufio.Reader) (dict Dict, err error)

func MustLoad

func MustLoad(filename string) Dict

func MustLoadReader

func MustLoadReader(reader *bufio.Reader) Dict

func (Dict) Delete

func (dict Dict) Delete(section, key string)

func (Dict) GetBool

func (dict Dict) GetBool(section, key string) (bool, bool)

func (Dict) GetBoolDef

func (dict Dict) GetBoolDef(section, key string, defVal bool) bool

func (Dict) GetDouble

func (dict Dict) GetDouble(section, key string) (float64, bool)

func (Dict) GetDoubleDef

func (dict Dict) GetDoubleDef(section, key string, defVal float64) float64

func (Dict) GetInt

func (dict Dict) GetInt(section, key string) (int, bool)

func (Dict) GetIntDef

func (dict Dict) GetIntDef(section, key string, defVal int) int

func (Dict) GetSections

func (dict Dict) GetSections() []string

func (Dict) GetString

func (dict Dict) GetString(section, key string) (string, bool)

func (Dict) GetStringDef

func (dict Dict) GetStringDef(section, key string, defVal string) string

func (Dict) SetBool

func (dict Dict) SetBool(section, key string, value bool)

func (Dict) SetDouble

func (dict Dict) SetDouble(section, key string, value float64)

func (Dict) SetInt

func (dict Dict) SetInt(section, key string, value int)

func (Dict) SetString

func (dict Dict) SetString(section, key, value string)

func (Dict) String

func (dict Dict) String() string

type Error

type Error string

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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