Documentation ¶
Overview ¶
Package configfile implements a config file loader and saver
Index ¶
- func LoadConfig(ctx context.Context)
- type Storage
- func (s *Storage) DeleteKey(section string, key string) bool
- func (s *Storage) DeleteSection(section string)
- func (s *Storage) GetKeyList(section string) []string
- func (s *Storage) GetSectionList() []string
- func (s *Storage) GetValue(section string, key string) (value string, found bool)
- func (s *Storage) HasSection(section string) bool
- func (s *Storage) Load() (err error)
- func (s *Storage) Save() error
- func (s *Storage) Serialize() (string, error)
- func (s *Storage) SetValue(section string, key string, value string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
LoadConfig installs the config file handler and calls config.LoadConfig
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage implements config.Storage for saving and loading config data in a simple INI based file.
func (*Storage) DeleteSection ¶
DeleteSection removes the named section and all config from the config file
func (*Storage) GetKeyList ¶
GetKeyList returns the keys in this section
func (*Storage) GetSectionList ¶
GetSectionList returns a slice of strings with names for all the sections
func (*Storage) HasSection ¶
HasSection returns true if section exists in the config file
Click to show internal directories.
Click to hide internal directories.