diff options
author | Valery Piashchynski <[email protected]> | 2020-12-17 18:23:19 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-17 18:23:19 +0300 |
commit | fbd5adde5abae6f7adb7fcdafc226bcd3480d498 (patch) | |
tree | 59ce0499568e0d4fd889d43de9a5eb1b17907a8e /plugins/config | |
parent | 7884349f27ed750825a0f4dea59af8964e182651 (diff) |
Move config interface to the interfaces folder. Initial redis plugin
structure
Diffstat (limited to 'plugins/config')
-rwxr-xr-x | plugins/config/configurer.go | 19 | ||||
-rwxr-xr-x | plugins/config/tests/plugin1.go | 6 |
2 files changed, 3 insertions, 22 deletions
diff --git a/plugins/config/configurer.go b/plugins/config/configurer.go deleted file mode 100755 index 00010eae..00000000 --- a/plugins/config/configurer.go +++ /dev/null @@ -1,19 +0,0 @@ -package config - -type Configurer interface { - // UnmarshalKey reads configuration section into configuration object. - // - // func (h *HttpService) Init(cp config.Configurer) error { - // h.config := &HttpConfig{} - // if err := configProvider.UnmarshalKey("http", h.config); err != nil { - // return err - // } - // } - UnmarshalKey(name string, out interface{}) error - - // Get used to get config section - Get(name string) interface{} - - // Has checks if config section exists. - Has(name string) bool -} diff --git a/plugins/config/tests/plugin1.go b/plugins/config/tests/plugin1.go index a276c15f..7b5d6bd8 100755 --- a/plugins/config/tests/plugin1.go +++ b/plugins/config/tests/plugin1.go @@ -4,7 +4,7 @@ import ( "errors" "time" - "github.com/spiral/roadrunner/v2/plugins/config" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" ) // ReloadConfig is a Reload configuration point. @@ -23,11 +23,11 @@ type ServiceConfig struct { } type Foo struct { - configProvider config.Configurer + configProvider config2.Configurer } // Depends on S2 and DB (S3 in the current case) -func (f *Foo) Init(p config.Configurer) error { +func (f *Foo) Init(p config2.Configurer) error { f.configProvider = p return nil } |