Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Singleton = NewConfigManager()
Functions ¶
func AddSource ¶
func AddSource(source ConfigSource)
Types ¶
type ConfigManager ¶
type ConfigManager struct { Options map[string]*ConfigOption // contains filtered or unexported fields }
func NewConfigManager ¶
func NewConfigManager() *ConfigManager
func (*ConfigManager) AddSource ¶
func (c *ConfigManager) AddSource(source ConfigSource)
func (*ConfigManager) Load ¶
func (c *ConfigManager) Load()
func (*ConfigManager) RegisterOption ¶
func (c *ConfigManager) RegisterOption(name, desc string, defaultValue interface{}) *ConfigOption
type ConfigOption ¶
type ConfigOption struct { Name string Description string DefaultValue interface{} LoadedValue interface{} Manager *ConfigManager }
func RegisterOption ¶
func RegisterOption(name, desc string, defaultValue interface{}) *ConfigOption
func (*ConfigOption) GetBool ¶
func (opt *ConfigOption) GetBool() bool
func (*ConfigOption) GetInt ¶
func (opt *ConfigOption) GetInt() int
func (*ConfigOption) GetString ¶
func (opt *ConfigOption) GetString() string
func (*ConfigOption) LoadValue ¶
func (opt *ConfigOption) LoadValue()
type ConfigSource ¶
type ConfigSource interface {
GetValue(key string) interface{}
}
Click to show internal directories.
Click to hide internal directories.