Documentation ¶
Overview ¶
Package configparser defines some default configs handler including a configparser parser with ability to update value dynamically
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyValue = fmt.Errorf("empty strings") ErrInvalidFormat = fmt.Errorf("invalid format") ErrInvalidOptionsMatch = fmt.Errorf("invalid options match") )
View Source
var Standalone = NewManager()
Standalone is a singleton config manager that acts as a general manager for iris.
View Source
var TestParser = NewManager()
TestParser acts as a test config manager.
Functions ¶
Types ¶
type EnvSource ¶
type EnvSource struct{}
var ( TestEnvSource *EnvSource EnvNameRegex = "(ENV|env)+" )
type Manager ¶
Manager holds types for generic managers to generate configs.
type Options ¶
type Options struct { // Name will have format iris.option1.option2 Name string Description string DefaultValue interface{} LoadedValue interface{} Manager *Manager ConfigSource Source }
func Register ¶
Register wraps around Manager.Register and can be accessed via configparser.Register.
func (*Options) LoadValue ¶
func (opt *Options) LoadValue()
LoadValue will load given values if exists, otherwise use default ones.
func (*Options) UpdateValue ¶
func (opt *Options) UpdateValue(val interface{})
UpdateValue updates loaded value.
Click to show internal directories.
Click to hide internal directories.