summaryrefslogtreecommitdiff
path: root/plugins/config/tests/plugin1.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/config/tests/plugin1.go')
-rwxr-xr-xplugins/config/tests/plugin1.go53
1 files changed, 0 insertions, 53 deletions
diff --git a/plugins/config/tests/plugin1.go b/plugins/config/tests/plugin1.go
deleted file mode 100755
index 724afbd4..00000000
--- a/plugins/config/tests/plugin1.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package tests
-
-import (
- "errors"
- "time"
-
- "github.com/spiral/roadrunner/v2/interfaces/config"
-)
-
-// ReloadConfig is a Reload configuration point.
-type ReloadConfig struct {
- Interval time.Duration
- Patterns []string
- Services map[string]ServiceConfig
-}
-
-type ServiceConfig struct {
- Enabled bool
- Recursive bool
- Patterns []string
- Dirs []string
- Ignore []string
-}
-
-type Foo struct {
- configProvider config.Configurer
-}
-
-// Depends on S2 and DB (S3 in the current case)
-func (f *Foo) Init(p config.Configurer) error {
- f.configProvider = p
- return nil
-}
-
-func (f *Foo) Serve() chan error {
- 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.New("should be at least one pattern, but got 0")
- }
-
- return errCh
-}
-
-func (f *Foo) Stop() error {
- return nil
-}