Documentation
¶
Index ¶
- func WithFind(filenames []string) func(*AConfig) error
- func WithFindOrCreate(filenames []string) func(*AConfig) error
- func WithKeyConstraints(keys []string) func(*AConfig) error
- func WithLoad(fileName string) func(*AConfig) error
- func WithLoadOrCreate(filename string) func(*AConfig) error
- func WithWindowsRegistry(key string) func(*AConfig) error
- type AConfig
- func (c *AConfig) Checkpoint() error
- func (c *AConfig) Dump()
- func (c *AConfig) Exists(key string) bool
- func (c *AConfig) GetBool(key string) (bool, error)
- func (c *AConfig) GetBoolDefault(key string, defaultValue bool) bool
- func (c *AConfig) GetInt(key string) (int, error)
- func (c *AConfig) GetInt64(key string) (int64, error)
- func (c *AConfig) GetInt64Default(key string, defaultValue int64) int64
- func (c *AConfig) GetIntDefault(key string, defaultValue int) int
- func (c *AConfig) GetStr(key string) (string, error)
- func (c *AConfig) GetStrDefault(key string, defaultValue string) string
- func (c *AConfig) Init()
- func (c *AConfig) Save(filename string) error
- func (c *AConfig) SetBool(key string, value bool) error
- func (c *AConfig) SetInt(key string, value int) error
- func (c *AConfig) SetInt64(key string, value int64) error
- func (c *AConfig) SetStr(key string, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithFindOrCreate ¶
func WithKeyConstraints ¶
func WithLoadOrCreate ¶
func WithWindowsRegistry ¶
Types ¶
type AConfig ¶
type AConfig struct {
Loaded bool // Configuration loaded
WindowsRegistry bool // Use the Windows registry (ignored on non-Windows systems)
WindowsRegistryKey string // Windows registry key (ignored on non-Windows systems)
ConfigFile string // Path to configuration file
KeyList []string // List of keys
Data map[string]string // Configuration data
}
AConfig holds all configuration data
func (*AConfig) Checkpoint ¶
Checkpoint saves the configuration to the last loaded file
func (*AConfig) GetBoolDefault ¶
GetBoolDefault retrieves a boolean value or the specified default
func (*AConfig) GetInt64Default ¶
GetInt64Default retrieves an int64 value or returns the specified default
func (*AConfig) GetIntDefault ¶
GetIntDefault retrieves an integer value or returns the specified default
func (*AConfig) GetStrDefault ¶
GetStrDefault retrieves a string value or returns the specified default
Click to show internal directories.
Click to hide internal directories.