Documentation
¶
Index ¶
- func CreateManager(configBasePath string, configInitialMode string, configEnvPrefix string) error
- func GetManager() *manager
- func NewCategoryNotExistErr(key string, err error) error
- func NewKeyNotExistErr(key, category string, err error) error
- func NewRemoteLoadErr(name interface{}, err error) error
- func NewRemoteResponseErr(err error) error
- type CategoryNotExistErr
- type KeyNotExistErr
- type RemoteLoadErr
- type RemoteResponseErr
- type ViperWrapper
- func (w *ViperWrapper) Get(key string, bypass bool) (interface{}, bool)
- func (w *ViperWrapper) Load() error
- func (w *ViperWrapper) LoadFromRemote(data []byte) error
- func (w *ViperWrapper) RegisterChangeCallback(fn func() interface{})
- func (w *ViperWrapper) Set(key string, value interface{}, bypass bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateManager ¶
CreateManager - Create a new manager instance
func GetManager ¶
func GetManager() *manager
func NewCategoryNotExistErr ¶
NewCategoryNotExistErr - return a new instance of CategoryNotExistErr
func NewKeyNotExistErr ¶
NewKeyNotExistErr - return a new instance of KeyNotExistErr
func NewRemoteLoadErr ¶
NewRemoteLoadErr - return a new instance of RemoteLoadErr
func NewRemoteResponseErr ¶
NewRemoteResponseErr - return a new instance of RemoteResponseErr
Types ¶
type CategoryNotExistErr ¶
type CategoryNotExistErr struct { Key interface{} Err error }
CategoryNotExistErr Error
func (*CategoryNotExistErr) Error ¶
func (err *CategoryNotExistErr) Error() string
Error method - satisfying error interface
type KeyNotExistErr ¶
type KeyNotExistErr struct { Key interface{} Category interface{} Err error }
KeyNotExistErr Error
func (*KeyNotExistErr) Error ¶
func (err *KeyNotExistErr) Error() string
Error method - satisfying error interface
type RemoteLoadErr ¶
type RemoteLoadErr struct { Name interface{} Err error }
RemoteLoadErr Error
func (*RemoteLoadErr) Error ¶
func (err *RemoteLoadErr) Error() string
Error method - satisfying error interface
type RemoteResponseErr ¶
type RemoteResponseErr struct {
Err error
}
RemoteResponseErr Error
func (*RemoteResponseErr) Error ¶
func (err *RemoteResponseErr) Error() string
Error method - satisfying error interface
type ViperWrapper ¶
type ViperWrapper struct { Instance *viper.Viper ConfigPath []string ConfigName string ConfigEnvPrefix string ConfigResourcePlace string // contains filtered or unexported fields }
ViperWrapper object
func (*ViperWrapper) Get ¶
func (w *ViperWrapper) Get(key string, bypass bool) (interface{}, bool)
Get method - returns value base on key
func (*ViperWrapper) Load ¶
func (w *ViperWrapper) Load() error
Load - It creates new instance of Viper and load config file base on ConfigName
func (*ViperWrapper) LoadFromRemote ¶
func (w *ViperWrapper) LoadFromRemote(data []byte) error
LoadFromRemote - loads the configs from the remote server
func (*ViperWrapper) RegisterChangeCallback ¶
func (w *ViperWrapper) RegisterChangeCallback(fn func() interface{})
RegisterChangeCallback - get function and call it when config file changed