iniconf

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSection = "default"

DefaultSection is the label for the default ini file section.

Functions

This section is empty.

Types

type ConfigMap

type ConfigMap map[string]map[string]string

ConfigMap is shorthand for the type used as a config struct.

func ParseFile

func ParseFile(fileName string) (ConfigMap, error)

ParseFile attempts to load the named config file.

func ParseReader

func ParseReader(r io.Reader) (ConfigMap, error)

ParseReader reads a configuration from an io.Reader.

func (ConfigMap) AddKeyVal

func (c ConfigMap) AddKeyVal(section, key, val string)

AddKeyVal adds a key value pair to a config map.

func (ConfigMap) AddSection

func (c ConfigMap) AddSection(section string)

AddSection creates a new section in the config map.

func (ConfigMap) GetValue

func (c ConfigMap) GetValue(section, key string) (string, bool)

GetValue retrieves the value from a key map.

func (ConfigMap) GetValueDefault

func (c ConfigMap) GetValueDefault(section, key, value string) string

GetValueDefault retrieves the value from a key map if present, otherwise the default value.

func (ConfigMap) ListSections

func (c ConfigMap) ListSections() []string

ListSections returns the list of sections in the config map.

func (ConfigMap) SectionInConfig

func (c ConfigMap) SectionInConfig(section string) bool

SectionInConfig determines whether a section is in the configuration.

func (ConfigMap) SectionKeys

func (c ConfigMap) SectionKeys(section string) ([]string, bool)

SectionKeys returns the sections in the config map.

func (ConfigMap) WriteFile

func (c ConfigMap) WriteFile(filename string) error

WriteFile writes out the configuration to a file.

Jump to

Keyboard shortcuts

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