Documentation
¶
Index ¶
- func BoolValue(s string) bool
- type INI
- func (ini *INI) ForceUpper()
- func (ini *INI) GetBool(s, k string) bool
- func (ini *INI) GetEnvBool(s, k string) bool
- func (ini *INI) GetEnvFloat(s, k string) float64
- func (ini *INI) GetEnvInt(s, k string) int64
- func (ini *INI) GetEnvString(s, k string) string
- func (ini *INI) GetFloat(s, k string) float64
- func (ini *INI) GetInt(s, k string) int64
- func (ini *INI) GetString(s, k string) string
- func (ini *INI) MakeSection(name string) *Section
- func (ini *INI) Marshal() string
- func (ini *INI) Set(s, k, v string)
- type Property
- type Section
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type INI ¶
type INI struct {
// Sections hold properties.
Sections map[string]*Section
Properties map[string]*Property
// contains filtered or unexported fields
}
INI main structure.
func (*INI) ForceUpper ¶
func (ini *INI) ForceUpper()
ForceUpper checks the environment for upper-case versions of the supplied INI variables.
func (*INI) GetBool ¶
GetBool returns the boolean value for a variable in the INI file. Non-existense results in false as the return value.
func (*INI) GetEnvBool ¶
GetEnvBool returns GetBool(), overriding with an environment variable if found.
func (*INI) GetEnvFloat ¶
GetEnvFloat returns GetFloat(), overriding with an environment variable if found.
func (*INI) GetEnvInt ¶
GetEnvInt returns GetInt(), overriding with an environment variable if found.
func (*INI) GetEnvString ¶
GetEnvString returns a variable from the specified section, or overridden by an environment variable.
func (*INI) GetFloat ¶
GetFloat returns the float value for a variable in the INI file. Non-existense results in 0 as the return value.
func (*INI) GetInt ¶
GetInt returns the integer value for a variable in the INI file. Non-existense results in 0 as the return value.
func (*INI) MakeSection ¶
MakeSection will create a new section, or return an existing one with the same name.
type Property ¶
type Property struct {
// Key is the name of the property/variable.
Key string
// Value is a string. Use Get*() to convert.
Value string
// Env variable name.
Env string
// contains filtered or unexported fields
}
Property holds a key string and value of any type.
type Section ¶
type Section struct {
// Name (title) of the section.
Name string
// Properties in this section.
Properties map[string]*Property
// contains filtered or unexported fields
}
Section with properties.