diff options
Diffstat (limited to 'cmd/rr/utils/config.go')
-rw-r--r-- | cmd/rr/utils/config.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/cmd/rr/utils/config.go b/cmd/rr/utils/config.go deleted file mode 100644 index 452dd195..00000000 --- a/cmd/rr/utils/config.go +++ /dev/null @@ -1,26 +0,0 @@ -package utils - -import ( - "github.com/spf13/viper" - "github.com/spiral/roadrunner/service" -) - -// ViperWrapper provides interface bridge between Viper configs and service.Config. -type ViperWrapper struct { - Viper *viper.Viper -} - -// Get nested config section (sub-map), returns nil if section not found. -func (w *ViperWrapper) Get(key string) service.Config { - sub := w.Viper.Sub(key) - if sub == nil { - return nil - } - - return &ViperWrapper{sub} -} - -// Unmarshal unmarshal config data into given struct. -func (w *ViperWrapper) Unmarshal(out interface{}) error { - return w.Viper.Unmarshal(out) -} |