summaryrefslogtreecommitdiff
path: root/tests/plugins/config/plugin3.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-03-31 19:10:42 +0300
committerValery Piashchynski <[email protected]>2021-03-31 19:33:27 +0300
commit0d5ddfc3952b03c37fc728017fc33d2c2db3fbff (patch)
treea39fd013243266f28da0e968d44bb419c2229a9b /tests/plugins/config/plugin3.go
parent486f576a70302978ce98654c318d5525359bacc6 (diff)
- Add tests and update CHANGELOGv2.1.0-beta.1
Diffstat (limited to 'tests/plugins/config/plugin3.go')
-rwxr-xr-xtests/plugins/config/plugin3.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/plugins/config/plugin3.go b/tests/plugins/config/plugin3.go
new file mode 100755
index 00000000..41b79259
--- /dev/null
+++ b/tests/plugins/config/plugin3.go
@@ -0,0 +1,34 @@
+package config
+
+import (
+ "time"
+
+ "github.com/spiral/errors"
+ "github.com/spiral/roadrunner/v2/plugins/config"
+)
+
+type Foo3 struct {
+ configProvider config.Configurer
+}
+
+// Depends on S2 and DB (S3 in the current case)
+func (f *Foo3) Init(p config.Configurer) error {
+ f.configProvider = p
+ return nil
+}
+
+func (f *Foo3) Serve() chan error {
+ const op = errors.Op("foo_plugin_serve")
+ errCh := make(chan error, 1)
+
+ if f.configProvider.GetCommonConfig().GracefulTimeout != time.Second*10 {
+ errCh <- errors.E(op, errors.Str("GracefulTimeout should be eq to 10 seconds"))
+ return errCh
+ }
+
+ return errCh
+}
+
+func (f *Foo3) Stop() error {
+ return nil
+}