Add options to config (#1450)

This commit is contained in:
Asim Aslam 2020-03-31 17:13:21 +01:00 committed by GitHub
parent 2674790694
commit 6c6c5359b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,8 @@ type Config interface {
reader.Values
// Init the config
Init(opts ...Option) error
// Options in the config
Options() Options
// Stop the config loader/watcher
Close() error
// Load config sources

View File

@ -67,6 +67,10 @@ func (c *config) Init(opts ...Option) error {
return nil
}
func (c *config) Options() Options {
return c.opts
}
func (c *config) run() {
watch := func(w loader.Watcher) error {
for {