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 | |
parent | 7884349f27ed750825a0f4dea59af8964e182651 (diff) |
Move config interface to the interfaces folder. Initial redis plugin
structure
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/checker/plugin.go | 4 | ||||
-rwxr-xr-x | plugins/config/configurer.go | 19 | ||||
-rwxr-xr-x | plugins/config/tests/plugin1.go | 6 | ||||
-rw-r--r-- | plugins/headers/plugin.go | 4 | ||||
-rw-r--r-- | plugins/http/plugin.go | 6 | ||||
-rw-r--r-- | plugins/http/tests/plugin1.go | 8 | ||||
-rw-r--r-- | plugins/http/tests/plugin_middleware.go | 10 | ||||
-rw-r--r-- | plugins/informer/tests/test_plugin.go | 6 | ||||
-rw-r--r-- | plugins/logger/plugin.go | 4 | ||||
-rw-r--r-- | plugins/logger/tests/plugin.go | 6 | ||||
-rw-r--r-- | plugins/metrics/plugin.go | 4 | ||||
-rw-r--r-- | plugins/metrics/tests/plugin1.go | 6 | ||||
-rw-r--r-- | plugins/redis/config.go | 18 | ||||
-rw-r--r-- | plugins/redis/plugin.go | 55 | ||||
-rw-r--r-- | plugins/redis/tests/configs/.rr-redis.yaml | 25 | ||||
-rw-r--r-- | plugins/reload/plugin.go | 4 | ||||
-rw-r--r-- | plugins/resetter/tests/test_plugin.go | 6 | ||||
-rwxr-xr-x | plugins/rpc/plugin.go | 4 | ||||
-rw-r--r-- | plugins/rpc/tests/plugin1.go | 6 | ||||
-rw-r--r-- | plugins/server/plugin.go | 4 | ||||
-rw-r--r-- | plugins/server/tests/plugin_pipes.go | 6 | ||||
-rw-r--r-- | plugins/server/tests/plugin_sockets.go | 6 | ||||
-rw-r--r-- | plugins/server/tests/plugin_tcp.go | 6 | ||||
-rw-r--r-- | plugins/static/plugin.go | 4 |
24 files changed, 154 insertions, 73 deletions
diff --git a/plugins/checker/plugin.go b/plugins/checker/plugin.go index e6250697..e3e7834a 100644 --- a/plugins/checker/plugin.go +++ b/plugins/checker/plugin.go @@ -9,9 +9,9 @@ import ( "github.com/gofiber/fiber/v2/middleware/logger" "github.com/spiral/endure" "github.com/spiral/errors" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/log" "github.com/spiral/roadrunner/v2/interfaces/status" - "github.com/spiral/roadrunner/v2/plugins/config" ) const ( @@ -26,7 +26,7 @@ type Plugin struct { cfg *Config } -func (c *Plugin) Init(log log.Logger, cfg config.Configurer) error { +func (c *Plugin) Init(log log.Logger, cfg config2.Configurer) error { const op = errors.Op("status plugin init") err := cfg.UnmarshalKey(PluginName, &c.cfg) if err != nil { 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 } diff --git a/plugins/headers/plugin.go b/plugins/headers/plugin.go index f1c6e6f3..e16f6187 100644 --- a/plugins/headers/plugin.go +++ b/plugins/headers/plugin.go @@ -5,7 +5,7 @@ import ( "strconv" "github.com/spiral/errors" - "github.com/spiral/roadrunner/v2/plugins/config" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" ) // ID contains default service name. @@ -20,7 +20,7 @@ type Plugin struct { // Init must return configure service and return true if service 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) error { +func (s *Plugin) Init(cfg config2.Configurer) error { const op = errors.Op("headers plugin init") err := cfg.UnmarshalKey(RootPluginName, &s.cfg) if err != nil { 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 } diff --git a/plugins/informer/tests/test_plugin.go b/plugins/informer/tests/test_plugin.go index 3fdefde3..80627801 100644 --- a/plugins/informer/tests/test_plugin.go +++ b/plugins/informer/tests/test_plugin.go @@ -4,10 +4,10 @@ import ( "context" "time" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/server" "github.com/spiral/roadrunner/v2/interfaces/worker" poolImpl "github.com/spiral/roadrunner/v2/pkg/pool" - "github.com/spiral/roadrunner/v2/plugins/config" ) var testPoolConfig = poolImpl.Config{ @@ -26,11 +26,11 @@ var testPoolConfig = poolImpl.Config{ // Gauge ////////////// type Plugin1 struct { - config config.Configurer + config config2.Configurer server server.Server } -func (p1 *Plugin1) Init(cfg config.Configurer, server server.Server) error { +func (p1 *Plugin1) Init(cfg config2.Configurer, server server.Server) error { p1.config = cfg p1.server = server return nil diff --git a/plugins/logger/plugin.go b/plugins/logger/plugin.go index 64b77a64..ec58b7d6 100644 --- a/plugins/logger/plugin.go +++ b/plugins/logger/plugin.go @@ -2,8 +2,8 @@ package logger import ( "github.com/spiral/endure" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/log" - "github.com/spiral/roadrunner/v2/plugins/config" "go.uber.org/zap" ) @@ -18,7 +18,7 @@ type ZapLogger struct { } // Init logger service. -func (z *ZapLogger) Init(cfg config.Configurer) error { +func (z *ZapLogger) Init(cfg config2.Configurer) error { err := cfg.UnmarshalKey(PluginName, &z.cfg) if err != nil { return err diff --git a/plugins/logger/tests/plugin.go b/plugins/logger/tests/plugin.go index 32238f63..4095e59d 100644 --- a/plugins/logger/tests/plugin.go +++ b/plugins/logger/tests/plugin.go @@ -2,16 +2,16 @@ package tests import ( "github.com/spiral/errors" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/log" - "github.com/spiral/roadrunner/v2/plugins/config" ) type Plugin struct { - config config.Configurer + config config2.Configurer log log.Logger } -func (p1 *Plugin) Init(cfg config.Configurer, log log.Logger) error { +func (p1 *Plugin) Init(cfg config2.Configurer, log log.Logger) error { p1.config = cfg p1.log = log return nil diff --git a/plugins/metrics/plugin.go b/plugins/metrics/plugin.go index c115826b..956166ee 100644 --- a/plugins/metrics/plugin.go +++ b/plugins/metrics/plugin.go @@ -11,9 +11,9 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spiral/endure" "github.com/spiral/errors" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/log" "github.com/spiral/roadrunner/v2/interfaces/metrics" - "github.com/spiral/roadrunner/v2/plugins/config" "golang.org/x/sys/cpu" ) @@ -40,7 +40,7 @@ type Plugin struct { } // Init service. -func (m *Plugin) Init(cfg config.Configurer, log log.Logger) error { +func (m *Plugin) Init(cfg config2.Configurer, log log.Logger) error { const op = errors.Op("Metrics Init") err := cfg.UnmarshalKey(PluginName, &m.cfg) if err != nil { diff --git a/plugins/metrics/tests/plugin1.go b/plugins/metrics/tests/plugin1.go index b48c415d..08dd2593 100644 --- a/plugins/metrics/tests/plugin1.go +++ b/plugins/metrics/tests/plugin1.go @@ -2,15 +2,15 @@ package tests import ( "github.com/prometheus/client_golang/prometheus" - "github.com/spiral/roadrunner/v2/plugins/config" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" ) // Gauge ////////////// 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/redis/config.go b/plugins/redis/config.go new file mode 100644 index 00000000..b39fcd00 --- /dev/null +++ b/plugins/redis/config.go @@ -0,0 +1,18 @@ +package redis + +type Config struct { + // Addr is address to use. If len > 1, cluster client will be used + Addr []string + // database number to use, 0 is used by default + DB int + // Master name for failover client, empty by default + Master string + // Redis password, empty by default + Password string +} + +// InitDefaults initializing fill config with default values +func (s *Config) InitDefaults() error { + s.Addr = []string{"localhost:6379"} // default addr is pointing to local storage + return nil +} diff --git a/plugins/redis/plugin.go b/plugins/redis/plugin.go index 65a229e1..64b6024e 100644 --- a/plugins/redis/plugin.go +++ b/plugins/redis/plugin.go @@ -1 +1,56 @@ package redis + +import ( + "github.com/go-redis/redis/v8" + "github.com/spiral/roadrunner/v2/interfaces/config" + "github.com/spiral/roadrunner/v2/interfaces/log" +) + +const PluginName = "redis" + +type Plugin struct { + // config for RR integration + cfg *Config + // redis client + universalClient *redis.UniversalClient + clusterClient *redis.ClusterClient + client *redis.Client + sentinelClient *redis.SentinelClient +} + +func (s *Plugin) GetClient() *redis.Client { + return s.client +} + +func (s *Plugin) GetUniversalClient() *redis.UniversalClient { + return s.universalClient +} + +func (s *Plugin) GetClusterClient() *redis.ClusterClient { + return s.clusterClient +} + +func (s *Plugin) GetSentinelClient() *redis.SentinelClient { + return s.sentinelClient +} + +func (s *Plugin) Init(cfg config.Configurer, log log.Logger) error { + _ = cfg + _ = log + _ = s.cfg + return nil +} + +func (s *Plugin) Serve() chan error { + errCh := make(chan error, 1) + + return errCh +} + +func (s Plugin) Stop() error { + return nil +} + +func (s *Plugin) Name() string { + return PluginName +} diff --git a/plugins/redis/tests/configs/.rr-redis.yaml b/plugins/redis/tests/configs/.rr-redis.yaml new file mode 100644 index 00000000..52198a35 --- /dev/null +++ b/plugins/redis/tests/configs/.rr-redis.yaml @@ -0,0 +1,25 @@ +redis: + - cluster: + addr: + - 'localhost:6379' + db: 0 + master: null + password: '' + - universal: + addr: + - 'localhost:6379' + db: 0 + master: null + password: '' + - default: + addr: + - 'localhost:6379' + db: 0 + master: null + password: '' + - sentinel: + addr: + - 'localhost:6379' + db: 0 + master: null + password: ''
\ No newline at end of file diff --git a/plugins/reload/plugin.go b/plugins/reload/plugin.go index 555ddb82..233c83a4 100644 --- a/plugins/reload/plugin.go +++ b/plugins/reload/plugin.go @@ -6,9 +6,9 @@ import ( "time" "github.com/spiral/errors" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/log" "github.com/spiral/roadrunner/v2/interfaces/resetter" - "github.com/spiral/roadrunner/v2/plugins/config" ) // PluginName contains default plugin name. @@ -25,7 +25,7 @@ type Plugin struct { } // Init controller service -func (s *Plugin) Init(cfg config.Configurer, log log.Logger, res resetter.Resetter) error { +func (s *Plugin) Init(cfg config2.Configurer, log log.Logger, res resetter.Resetter) error { const op = errors.Op("reload plugin init") s.cfg = &Config{} InitDefaults(s.cfg) diff --git a/plugins/resetter/tests/test_plugin.go b/plugins/resetter/tests/test_plugin.go index 1d770e70..f1c09caf 100644 --- a/plugins/resetter/tests/test_plugin.go +++ b/plugins/resetter/tests/test_plugin.go @@ -4,9 +4,9 @@ import ( "context" "time" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/server" poolImpl "github.com/spiral/roadrunner/v2/pkg/pool" - "github.com/spiral/roadrunner/v2/plugins/config" ) var testPoolConfig = poolImpl.Config{ @@ -25,11 +25,11 @@ var testPoolConfig = poolImpl.Config{ // Gauge ////////////// type Plugin1 struct { - config config.Configurer + config config2.Configurer server server.Server } -func (p1 *Plugin1) Init(cfg config.Configurer, server server.Server) error { +func (p1 *Plugin1) Init(cfg config2.Configurer, server server.Server) error { p1.config = cfg p1.server = server return nil diff --git a/plugins/rpc/plugin.go b/plugins/rpc/plugin.go index c8e63496..8d308561 100755 --- a/plugins/rpc/plugin.go +++ b/plugins/rpc/plugin.go @@ -8,9 +8,9 @@ import ( "github.com/spiral/endure" "github.com/spiral/errors" "github.com/spiral/goridge/v3" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/log" rpc_ "github.com/spiral/roadrunner/v2/interfaces/rpc" - "github.com/spiral/roadrunner/v2/plugins/config" ) // PluginName contains default plugin name. @@ -32,7 +32,7 @@ type Plugin struct { } // Init rpc service. Must return true if service is enabled. -func (s *Plugin) Init(cfg config.Configurer, log log.Logger) error { +func (s *Plugin) Init(cfg config2.Configurer, log log.Logger) error { const op = errors.Op("RPC Init") if !cfg.Has(PluginName) { return errors.E(op, errors.Disabled) diff --git a/plugins/rpc/tests/plugin1.go b/plugins/rpc/tests/plugin1.go index 79e98ed4..dcb256fa 100644 --- a/plugins/rpc/tests/plugin1.go +++ b/plugins/rpc/tests/plugin1.go @@ -3,14 +3,14 @@ package tests import ( "fmt" - "github.com/spiral/roadrunner/v2/plugins/config" + 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/server/plugin.go b/plugins/server/plugin.go index e6003fbc..8555fd7e 100644 --- a/plugins/server/plugin.go +++ b/plugins/server/plugin.go @@ -8,6 +8,7 @@ import ( "strings" "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" @@ -16,7 +17,6 @@ import ( "github.com/spiral/roadrunner/v2/pkg/pipe" poolImpl "github.com/spiral/roadrunner/v2/pkg/pool" "github.com/spiral/roadrunner/v2/pkg/socket" - "github.com/spiral/roadrunner/v2/plugins/config" "github.com/spiral/roadrunner/v2/util" ) @@ -30,7 +30,7 @@ type Plugin struct { } // Init application provider. -func (server *Plugin) Init(cfg config.Configurer, log log.Logger) error { +func (server *Plugin) Init(cfg config2.Configurer, log log.Logger) error { const op = errors.Op("Init") err := cfg.UnmarshalKey(PluginName, &server.cfg) if err != nil { diff --git a/plugins/server/tests/plugin_pipes.go b/plugins/server/tests/plugin_pipes.go index 61c9a8f9..f613cf98 100644 --- a/plugins/server/tests/plugin_pipes.go +++ b/plugins/server/tests/plugin_pipes.go @@ -5,12 +5,12 @@ import ( "time" "github.com/spiral/errors" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/pool" "github.com/spiral/roadrunner/v2/interfaces/server" "github.com/spiral/roadrunner/v2/internal" poolImpl "github.com/spiral/roadrunner/v2/pkg/pool" "github.com/spiral/roadrunner/v2/pkg/worker" - "github.com/spiral/roadrunner/v2/plugins/config" plugin "github.com/spiral/roadrunner/v2/plugins/server" ) @@ -32,12 +32,12 @@ var testPoolConfig = poolImpl.Config{ } type Foo struct { - configProvider config.Configurer + configProvider config2.Configurer wf server.Server pool pool.Pool } -func (f *Foo) Init(p config.Configurer, workerFactory server.Server) error { +func (f *Foo) Init(p config2.Configurer, workerFactory server.Server) error { f.configProvider = p f.wf = workerFactory return nil diff --git a/plugins/server/tests/plugin_sockets.go b/plugins/server/tests/plugin_sockets.go index 3b97efff..72b4d1a8 100644 --- a/plugins/server/tests/plugin_sockets.go +++ b/plugins/server/tests/plugin_sockets.go @@ -4,21 +4,21 @@ import ( "context" "github.com/spiral/errors" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/pool" "github.com/spiral/roadrunner/v2/interfaces/server" "github.com/spiral/roadrunner/v2/internal" "github.com/spiral/roadrunner/v2/pkg/worker" - "github.com/spiral/roadrunner/v2/plugins/config" plugin "github.com/spiral/roadrunner/v2/plugins/server" ) type Foo2 struct { - configProvider config.Configurer + configProvider config2.Configurer wf server.Server pool pool.Pool } -func (f *Foo2) Init(p config.Configurer, workerFactory server.Server) error { +func (f *Foo2) Init(p config2.Configurer, workerFactory server.Server) error { f.configProvider = p f.wf = workerFactory return nil diff --git a/plugins/server/tests/plugin_tcp.go b/plugins/server/tests/plugin_tcp.go index 2857dadc..aa741deb 100644 --- a/plugins/server/tests/plugin_tcp.go +++ b/plugins/server/tests/plugin_tcp.go @@ -4,21 +4,21 @@ import ( "context" "github.com/spiral/errors" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/pool" "github.com/spiral/roadrunner/v2/interfaces/server" "github.com/spiral/roadrunner/v2/internal" "github.com/spiral/roadrunner/v2/pkg/worker" - "github.com/spiral/roadrunner/v2/plugins/config" plugin "github.com/spiral/roadrunner/v2/plugins/server" ) type Foo3 struct { - configProvider config.Configurer + configProvider config2.Configurer wf server.Server pool pool.Pool } -func (f *Foo3) Init(p config.Configurer, workerFactory server.Server) error { +func (f *Foo3) Init(p config2.Configurer, workerFactory server.Server) error { f.configProvider = p f.wf = workerFactory return nil diff --git a/plugins/static/plugin.go b/plugins/static/plugin.go index cf5cee25..fd8d0a9c 100644 --- a/plugins/static/plugin.go +++ b/plugins/static/plugin.go @@ -5,8 +5,8 @@ import ( "path" "github.com/spiral/errors" + config2 "github.com/spiral/roadrunner/v2/interfaces/config" "github.com/spiral/roadrunner/v2/interfaces/log" - "github.com/spiral/roadrunner/v2/plugins/config" ) // ID contains default service name. @@ -27,7 +27,7 @@ type Plugin struct { // Init must return configure service and return true if service 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) error { +func (s *Plugin) Init(cfg config2.Configurer, log log.Logger) error { const op = errors.Op("static plugin init") err := cfg.UnmarshalKey(RootPluginName, &s.cfg) if err != nil { |