Documentation
¶
Index ¶
- type DefaultManager
- func (m *DefaultManager) GetBoolWithDefault(key string, defaultValue bool) bool
- func (m *DefaultManager) GetDurationWithDefault(key string, defaultValue time.Duration) time.Duration
- func (m *DefaultManager) GetInt(key string) (int, error)
- func (m *DefaultManager) GetIntWithDefault(key string, defaultValue int) int
- func (m *DefaultManager) GetModelConfig() ModelConfig
- func (m *DefaultManager) GetString(key string) (string, error)
- func (m *DefaultManager) GetStringWithDefault(key, defaultValue string) string
- func (m *DefaultManager) RequireString(key string) string
- type Manager
- type ModelConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultManager ¶
type DefaultManager struct {
}
DefaultManager implements the Manager interface
func (*DefaultManager) GetBoolWithDefault ¶
func (m *DefaultManager) GetBoolWithDefault(key string, defaultValue bool) bool
GetBoolWithDefault gets a boolean configuration value by key, returns default if not found or invalid
func (*DefaultManager) GetDurationWithDefault ¶ added in v0.1.6
func (m *DefaultManager) GetDurationWithDefault(key string, defaultValue time.Duration) time.Duration
GetDurationWithDefault gets a duration configuration value by key, returns default if not found or invalid
func (*DefaultManager) GetInt ¶
func (m *DefaultManager) GetInt(key string) (int, error)
GetInt gets an integer configuration value by key, returns error if not found or invalid
func (*DefaultManager) GetIntWithDefault ¶
func (m *DefaultManager) GetIntWithDefault(key string, defaultValue int) int
GetIntWithDefault gets an integer configuration value by key, returns default if not found or invalid
func (*DefaultManager) GetModelConfig ¶
func (m *DefaultManager) GetModelConfig() ModelConfig
GetModelConfig returns the default model configuration from environment variables or defaults
func (*DefaultManager) GetString ¶
func (m *DefaultManager) GetString(key string) (string, error)
GetString gets a configuration value by key, returns error if not found
func (*DefaultManager) GetStringWithDefault ¶
func (m *DefaultManager) GetStringWithDefault(key, defaultValue string) string
GetStringWithDefault gets a configuration value by key, returns default if not found
func (*DefaultManager) RequireString ¶
func (m *DefaultManager) RequireString(key string) string
RequireString gets a configuration value by key, panics if not found
type Manager ¶
type Manager interface {
GetString(key string) (string, error)
GetStringWithDefault(key, defaultValue string) string
RequireString(key string) string
GetInt(key string) (int, error)
GetIntWithDefault(key string, defaultValue int) int
GetBoolWithDefault(key string, defaultValue bool) bool
GetDurationWithDefault(key string, defaultValue time.Duration) time.Duration
GetModelConfig() ModelConfig
}
Manager provides configuration management functionality
func NewConfigManager ¶
func NewConfigManager() Manager
NewConfigManager creates a new default config manager