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 ConfigSource ConfigSource }
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 RedisConfigStore ¶ added in v1.24.6
type RedisConfigStore struct {
Pool *radix.Pool
}
func (*RedisConfigStore) GetValue ¶ added in v1.24.6
func (rs *RedisConfigStore) GetValue(key string) interface{}
func (*RedisConfigStore) Name ¶ added in v1.24.6
func (e *RedisConfigStore) Name() string
func (*RedisConfigStore) SaveValue ¶ added in v1.24.6
func (rs *RedisConfigStore) SaveValue(key, value string) error
Click to show internal directories.
Click to hide internal directories.