Documentation
¶
Index ¶
- Constants
- type INI
- type INIField
- func (f *INIField) GetBool(key string) bool
- func (f *INIField) GetFloat(key string) float64
- func (f *INIField) GetInt(key string) int64
- func (f *INIField) SetBool(key string, value bool)
- func (f *INIField) SetFloat(key string, value float64)
- func (f *INIField) SetInt(key string, value int64)
- func (f *INIField) SetString(key, value string)
- type INISection
- func (s *INISection) AddBool(key string, value bool)
- func (s *INISection) AddFloat(key string, value float64)
- func (s *INISection) AddInt(key string, value int64)
- func (s *INISection) AddString(key string, value string)
- func (s *INISection) GetBool(key string, alt bool) bool
- func (s *INISection) GetFloat(key string, alt float64) float64
- func (s *INISection) GetInt(key string, alt int64) int64
- func (s *INISection) GetString(key, alt string) string
Constants ¶
const ( // Bool type Bool = iota // Int type Int // INIFloat type Float // String type String )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type INI ¶
type INI struct {
// Sections with settings.
Sections map[string]*INISection
// Order sections were loaded or added in.
Order []string
}
INI file base structure.
func (*INI) AddSection ¶
func (ini *INI) AddSection(name string) *INISection
AddSection to INI structure.
type INIField ¶
type INIField struct {
// Value will be stripped of surrounding whitespace when loaded.
Value string
// Type lets the user choose which Get* method to use when loading unknown files.
Type byte
// contains filtered or unexported fields
}
INIField contains a variable and its data.
type INISection ¶
type INISection struct {
Fields map[string]*INIField
// Order fields were loaded or added in.
Order []string
}
INISection holds one or more fields.
func (*INISection) AddBool ¶
func (s *INISection) AddBool(key string, value bool)
AddBool adds a new bool field to the section.
func (*INISection) AddFloat ¶
func (s *INISection) AddFloat(key string, value float64)
AddFloat adds a new float64 field to the section.
func (*INISection) AddInt ¶
func (s *INISection) AddInt(key string, value int64)
AddInt adds a new int64 field to the section.
func (*INISection) AddString ¶
func (s *INISection) AddString(key string, value string)
AddString adds a new string field to the section.
func (*INISection) GetBool ¶
func (s *INISection) GetBool(key string, alt bool) bool
GetBool returns a field as a bool, or the alternative.
func (*INISection) GetFloat ¶
func (s *INISection) GetFloat(key string, alt float64) float64
GetFloat returns a field as a float64, or the alternative.
func (*INISection) GetInt ¶
func (s *INISection) GetInt(key string, alt int64) int64
GetInt returns a field as an int64, or the alternative.
func (*INISection) GetString ¶
func (s *INISection) GetString(key, alt string) string
GetString returns a field as a string, or the alternative.