From 6c6c5359b188597d73455bda91ca40f2fde1d3c2 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Tue, 31 Mar 2020 17:13:21 +0100 Subject: [PATCH] Add options to config (#1450) --- config/config.go | 2 ++ config/default.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/config/config.go b/config/config.go index d70d5778..cd30f8b2 100644 --- a/config/config.go +++ b/config/config.go @@ -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 diff --git a/config/default.go b/config/default.go index 0b70cbcf..905ccad7 100644 --- a/config/default.go +++ b/config/default.go @@ -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 {