Documentation ¶
Overview ¶
Package viper provides a wrapper for the https://github.com/spf13/viper package. It offers a different callback function, to get access to the viper instance. By default, the watcher will automatically unmarshal the data of the defined configuration struct. TODO: add remote features
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOptions = errors.New("viper-provider: options must be of type viper.Options") ErrMandatory = errors.New("viper-provider: viper.Options file-name, path and type are mandatory") )
Error messages
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { // FileName of the configuration. FileName string // FileType optional if the filename has no extension. FileType string // FilePath to look into. FilePath string // Watch for file changes. Watch bool // WatchCallback can be defined. // By default, the config struct gets updated on changes. WatchCallback func(cfg interface{}, viper *viper.Viper, e fsnotify.Event) // EnvPrefix EnvPrefix string // EnvAutomatic check if environment variables match any of the existing keys. EnvAutomatic bool // EnvBind binds a Viper key to a ENV variable. EnvBind []string }
Options for the viper provider.
Click to show internal directories.
Click to hide internal directories.