summaryrefslogtreecommitdiff
path: root/plugins/http
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-17 18:23:19 +0300
committerValery Piashchynski <[email protected]>2020-12-17 18:23:19 +0300
commitfbd5adde5abae6f7adb7fcdafc226bcd3480d498 (patch)
tree59ce0499568e0d4fd889d43de9a5eb1b17907a8e /plugins/http
parent7884349f27ed750825a0f4dea59af8964e182651 (diff)
Move config interface to the interfaces folder. Initial redis plugin
structure
Diffstat (limited to 'plugins/http')
-rw-r--r--plugins/http/plugin.go6
-rw-r--r--plugins/http/tests/plugin1.go8
-rw-r--r--plugins/http/tests/plugin_middleware.go10
3 files changed, 13 insertions, 11 deletions
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go
index 460263f6..a883735a 100644
--- a/plugins/http/plugin.go
+++ b/plugins/http/plugin.go
@@ -15,6 +15,7 @@ import (
"github.com/hashicorp/go-multierror"
"github.com/spiral/endure"
"github.com/spiral/errors"
+ config2 "github.com/spiral/roadrunner/v2/interfaces/config"
"github.com/spiral/roadrunner/v2/interfaces/events"
"github.com/spiral/roadrunner/v2/interfaces/log"
"github.com/spiral/roadrunner/v2/interfaces/pool"
@@ -22,7 +23,6 @@ import (
"github.com/spiral/roadrunner/v2/interfaces/status"
"github.com/spiral/roadrunner/v2/interfaces/worker"
poolImpl "github.com/spiral/roadrunner/v2/pkg/pool"
- "github.com/spiral/roadrunner/v2/plugins/config"
"github.com/spiral/roadrunner/v2/plugins/http/attributes"
"github.com/spiral/roadrunner/v2/util"
"golang.org/x/net/http2"
@@ -49,7 +49,7 @@ type middleware map[string]Middleware
type Plugin struct {
sync.Mutex
- configurer config.Configurer
+ configurer config2.Configurer
server server.Server
log log.Logger
@@ -80,7 +80,7 @@ func (s *Plugin) AddListener(listener events.EventListener) {
// Init must return configure svc and return true if svc hasStatus enabled. Must return error in case of
// misconfiguration. Services must not be used without proper configuration pushed first.
-func (s *Plugin) Init(cfg config.Configurer, log log.Logger, server server.Server) error {
+func (s *Plugin) Init(cfg config2.Configurer, log log.Logger, server server.Server) error {
const op = errors.Op("http Init")
err := cfg.UnmarshalKey(PluginName, &s.cfg)
if err != nil {
diff --git a/plugins/http/tests/plugin1.go b/plugins/http/tests/plugin1.go
index 1cbca744..7d1f32a1 100644
--- a/plugins/http/tests/plugin1.go
+++ b/plugins/http/tests/plugin1.go
@@ -1,12 +1,14 @@
package tests
-import "github.com/spiral/roadrunner/v2/plugins/config"
+import (
+ config2 "github.com/spiral/roadrunner/v2/interfaces/config"
+)
type Plugin1 struct {
- config config.Configurer
+ config config2.Configurer
}
-func (p1 *Plugin1) Init(cfg config.Configurer) error {
+func (p1 *Plugin1) Init(cfg config2.Configurer) error {
p1.config = cfg
return nil
}
diff --git a/plugins/http/tests/plugin_middleware.go b/plugins/http/tests/plugin_middleware.go
index de829d34..224d4117 100644
--- a/plugins/http/tests/plugin_middleware.go
+++ b/plugins/http/tests/plugin_middleware.go
@@ -3,14 +3,14 @@ package tests
import (
"net/http"
- "github.com/spiral/roadrunner/v2/plugins/config"
+ config2 "github.com/spiral/roadrunner/v2/interfaces/config"
)
type PluginMiddleware struct {
- config config.Configurer
+ config config2.Configurer
}
-func (p *PluginMiddleware) Init(cfg config.Configurer) error {
+func (p *PluginMiddleware) Init(cfg config2.Configurer) error {
p.config = cfg
return nil
}
@@ -34,10 +34,10 @@ func (p *PluginMiddleware) Name() string {
}
type PluginMiddleware2 struct {
- config config.Configurer
+ config config2.Configurer
}
-func (p *PluginMiddleware2) Init(cfg config.Configurer) error {
+func (p *PluginMiddleware2) Init(cfg config2.Configurer) error {
p.config = cfg
return nil
}