Documentation ¶
Overview ¶
Package 'cfg' provides functions for reading and writing configuration files and their coresponding string values.
Ignores '#' as comments, ','s denote multiple values. # Example config file. [section] key = value key2 = value1, value2 key3 = value1, value2, value3 [section2] key = value1, value2, value3
Index ¶
- type Store
- func (s *Store) Defaults(input string) (err error)
- func (s *Store) Exists(input ...string) (found bool)
- func (s *Store) File(file string) (err error)
- func (s *Store) Get(section, key string) string
- func (s *Store) GetBool(section, key string) (output bool)
- func (s *Store) GetFloat(section, key string) (output float64)
- func (s *Store) GetInt(section, key string) (output int64)
- func (s *Store) GetUint(section, key string) (output uint64)
- func (s *Store) Keys(section string) (out []string)
- func (s *Store) MGet(section, key string) []string
- func (s *Store) Parse(input string) (err error)
- func (s *Store) SGet(section, key string) string
- func (s *Store) Sanitize(section string, keys []string) (err error)
- func (s *Store) Save(sections ...string) error
- func (s *Store) Sections() (out []string)
- func (s *Store) Set(section, key string, value ...interface{}) (err error)
- func (s *Store) TrimSave(sections ...string) error
- func (s *Store) Unset(input ...string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Get ¶
Return only the first entry, if there are multiple entries the rest are skipped.
func (*Store) Save ¶
Saves [section](s) to file, recording all key = value pairs, if empty, save all sections.
Click to show internal directories.
Click to hide internal directories.