Documentation
¶
Index ¶
- func ConfigPath() string
- type Config
- type Container
- func (c *Container) AddObserver(o Observer)
- func (c *Container) AddObserverFunc(f func(*Container, chan error))
- func (c *Container) Dump() string
- func (c *Container) Exist() bool
- func (c *Container) Get(key string) interface{}
- func (c *Container) GetBool(key string) bool
- func (c *Container) GetDuration(key string) time.Duration
- func (c *Container) GetFloat(key string) float64
- func (c *Container) GetInt(key string) int
- func (c *Container) GetString(key string) string
- func (c *Container) GetTime(key string) time.Time
- func (c *Container) GetViper() *viper.Viper
- func (c *Container) Has(key string) bool
- func (c *Container) Sub(key string) *Container
- type Observer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
func ConfigPath() string
Types ¶
type Config ¶
type Config interface {
Get(key string) interface{}
GetBool(key string) bool
GetInt(key string) int
GetFloat(key string) float64
GetString(key string) string
GetTime(key string) time.Time
GetDuration(key string) time.Duration
GetViper() *viper.Viper
Has(key string) bool
Sub(key string) *Container
AddObserver(o Observer)
AddObserverFunc(f func(*Container, chan error))
Dump() string
Exist() bool
}
type Container ¶
Container container for configuration
func NewFilesContainer ¶
NewFilesContainer Initialise configuration container to read files from the FS
func NewReaderContainer ¶
NewReaderContainer Initialise configuration container to read config from ioReader
func (*Container) AddObserver ¶
AddObserver attach observer to trigger on config update
func (*Container) AddObserverFunc ¶
AddObserverFunc attach function to trigger on config update
func (*Container) GetDuration ¶
GetDuration get duration value from config
Click to show internal directories.
Click to hide internal directories.