summaryrefslogtreecommitdiff
path: root/plugins/config
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-10-26 12:01:53 +0300
committerGitHub <[email protected]>2020-10-26 12:01:53 +0300
commit91cf918b30938129609323ded53e190385e019a6 (patch)
tree0ad9537bd438c63719fb83343ab77fc4ab34eb83 /plugins/config
parent68bf13772c6ddfc5159c2a286e1a38e911614e72 (diff)
parent9aae9e2009bad07ebdee73e1c6cf56901d07880a (diff)
Merge pull request #373 from spiral/feature/new-worker-produces-active-worker
Feature/new worker produces active worker
Diffstat (limited to 'plugins/config')
-rwxr-xr-xplugins/config/provider.go2
-rwxr-xr-xplugins/config/tests/config_test.go2
-rwxr-xr-xplugins/config/viper.go3
3 files changed, 4 insertions, 3 deletions
diff --git a/plugins/config/provider.go b/plugins/config/provider.go
index 580231fd..ac33b3de 100755
--- a/plugins/config/provider.go
+++ b/plugins/config/provider.go
@@ -1,7 +1,7 @@
package config
type Provider interface {
- // Unmarshal configuration section into configuration object.
+ // UnmarshalKey reads configuration section into configuration object.
//
// func (h *HttpService) Init(cp config.Provider) error {
// h.config := &HttpConfig{}
diff --git a/plugins/config/tests/config_test.go b/plugins/config/tests/config_test.go
index c85a841f..14e60ac2 100755
--- a/plugins/config/tests/config_test.go
+++ b/plugins/config/tests/config_test.go
@@ -48,7 +48,7 @@ func TestViperProvider_Init(t *testing.T) {
for {
select {
case e := <-errCh:
- assert.NoError(t, e.Error.Err)
+ assert.NoError(t, e.Error)
assert.NoError(t, container.Stop())
return
case <-c:
diff --git a/plugins/config/viper.go b/plugins/config/viper.go
index 0c34313c..4e85af6b 100755
--- a/plugins/config/viper.go
+++ b/plugins/config/viper.go
@@ -14,6 +14,7 @@ type ViperProvider struct {
Prefix string
}
+// Inits config provider.
func (v *ViperProvider) Init() error {
v.viper = viper.New()
@@ -49,7 +50,7 @@ func (v *ViperProvider) Overwrite(values map[string]string) error {
return nil
}
-//
+// UnmarshalKey reads configuration section into configuration object.
func (v *ViperProvider) UnmarshalKey(name string, out interface{}) error {
err := v.viper.UnmarshalKey(name, &out)
if err != nil {