diff options
author | Valery Piashchynski <[email protected]> | 2021-09-16 21:46:50 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-09-16 21:46:50 +0300 |
commit | 3581b45f237a3f7aa29591ceb2bf6f4a4642a2f5 (patch) | |
tree | e723b19ec1ac16b7ccc7b3c2da69d4a416d63d81 /tests/plugins/config/plugin2.go | |
parent | 337d292dd2d6ff0a555098b1970d8194d8df8bc2 (diff) | |
parent | 823d831b57b75f70c7c3bbbee355f2016633bb3b (diff) |
[#803]: feat(plugins): move plugins to a separate repositoryv2.5.0-alpha.2
[#803]: feat(plugins): move plugins to a separate repository
Diffstat (limited to 'tests/plugins/config/plugin2.go')
-rwxr-xr-x | tests/plugins/config/plugin2.go | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/tests/plugins/config/plugin2.go b/tests/plugins/config/plugin2.go deleted file mode 100755 index 8c6f36c1..00000000 --- a/tests/plugins/config/plugin2.go +++ /dev/null @@ -1,50 +0,0 @@ -package config - -import ( - "github.com/spiral/errors" - "github.com/spiral/roadrunner/v2/plugins/config" -) - -type Foo2 struct { - configProvider config.Configurer -} - -// Depends on S2 and DB (S3 in the current case) -func (f *Foo2) Init(p config.Configurer) error { - f.configProvider = p - return nil -} - -func (f *Foo2) Serve() chan error { - const op = errors.Op("foo_plugin_serve") - errCh := make(chan error, 1) - - r := &ReloadConfig{} - err := f.configProvider.UnmarshalKey("reload", r) - if err != nil { - errCh <- err - } - - if len(r.Patterns) == 0 { - errCh <- errors.E(op, errors.Str("should be at least one pattern, but got 0")) - return errCh - } - - var allCfg AllConfig - err = f.configProvider.Unmarshal(&allCfg) - if err != nil { - errCh <- errors.E(op, errors.Str("should be at least one pattern, but got 0")) - return errCh - } - - if allCfg.RPC.Listen != "tcp://127.0.0.1:36643" { - errCh <- errors.E(op, errors.Str("RPC.Listen should be overwritten")) - return errCh - } - - return errCh -} - -func (f *Foo2) Stop() error { - return nil -} |