package iniconf
import "git.wntrmute.dev/kyle/goutils/config/iniconf"
Index ¶
- Variables
- type ConfigMap
- func ParseFile(fileName string) (cfg ConfigMap, err error)
- func ParseReader(r io.Reader) (cfg ConfigMap, err error)
- func (c ConfigMap) AddKeyVal(section, key, val string)
- func (c ConfigMap) AddSection(section string)
- func (c ConfigMap) GetValue(section, key string) (val string, present bool)
- func (c ConfigMap) GetValueDefault(section, key, value string) (val string)
- func (c ConfigMap) ListSections() (sections []string)
- func (c ConfigMap) SectionInConfig(section string) bool
- func (c ConfigMap) SectionKeys(section string) (keys []string, present bool)
- func (c ConfigMap) WriteFile(filename string) (err error)
Variables ¶
var DefaultSection = "default"
DefaultSection is the label for the default ini file section.
Types ¶
type ConfigMap ¶
ConfigMap is shorthand for the type used as a config struct.
func ParseFile ¶
ParseFile attempts to load the named config file.
func ParseReader ¶
ParseReader reads a configuration from an io.Reader.
func (ConfigMap) AddKeyVal ¶
AddKeyVal adds a key value pair to a config map.
func (ConfigMap) AddSection ¶
AddSection creates a new section in the config map.
func (ConfigMap) GetValue ¶
GetValue retrieves the value from a key map.
func (ConfigMap) GetValueDefault ¶
GetValueDefault retrieves the value from a key map if present, otherwise the default value.
func (ConfigMap) ListSections ¶
ListSections returns the list of sections in the config map.
func (ConfigMap) SectionInConfig ¶
SectionInConfig determines whether a section is in the configuration.
func (ConfigMap) SectionKeys ¶
SectionKeys returns the sections in the config map.
func (ConfigMap) WriteFile ¶
WriteFile writes out the configuration to a file.
Source Files ¶
iniconf.go
- Version
- v1.7.7 (latest)
- Published
- Jun 15, 2024
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 3 days ago –
Tools for package owners.