summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md5
-rwxr-xr-xMakefile3
-rwxr-xr-xplugins/config/plugin.go4
-rw-r--r--plugins/gzip/plugin.go4
-rw-r--r--plugins/headers/plugin.go4
-rw-r--r--plugins/http/plugin.go4
-rw-r--r--plugins/informer/interface.go4
-rw-r--r--plugins/kv/drivers/boltdb/plugin.go4
-rw-r--r--plugins/kv/drivers/memcached/plugin.go4
-rw-r--r--plugins/kv/drivers/memory/plugin.go3
-rw-r--r--plugins/kv/storage.go3
-rw-r--r--plugins/logger/plugin.go3
-rw-r--r--plugins/metrics/plugin.go3
-rw-r--r--plugins/redis/plugin.go3
-rw-r--r--plugins/reload/plugin.go3
-rw-r--r--plugins/resetter/plugin.go3
-rw-r--r--plugins/rpc/plugin.go3
-rw-r--r--plugins/server/plugin.go3
-rw-r--r--plugins/service/plugin.go3
-rw-r--r--plugins/status/plugin.go4
-rw-r--r--tests/plugins/informer/test_plugin.go4
21 files changed, 24 insertions, 50 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 57d17096..3ed7c7bb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,12 +13,15 @@ v2.2.0 (11.05.2021)
, `weak` and `pattern`.
### Option `always` was deleted from the plugin.
-- ✏️
+
+- ✏️ Update `informer.List` implementation. Now it returns a list with the all available plugins in the runtime.
## 🩹 Fixes:
- 🐛 Fix: issue with wrong ordered middlewares (reverse). Now the order is correct.
+---
+
v2.1.1 (29.04.2021)
-------------------
diff --git a/Makefile b/Makefile
index 8cce149a..2d14a101 100755
--- a/Makefile
+++ b/Makefile
@@ -47,9 +47,6 @@ test_coverage:
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage/redis.out -covermode=atomic ./tests/plugins/redis
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage/resetter.out -covermode=atomic ./tests/plugins/resetter
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage/rpc.out -covermode=atomic ./tests/plugins/rpc
- go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage/boltdb.out -covermode=atomic ./tests/plugins/kv/boltdb
- go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage/memory.out -covermode=atomic ./tests/plugins/kv/memory
- go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage/memcached.out -covermode=atomic ./tests/plugins/kv/memcached
go test -v -race -cover -tags=debug -coverpkg=./... -coverprofile=./coverage/kv_plugin.out -covermode=atomic ./tests/plugins/kv
cat ./coverage/*.out > ./coverage/summary.out
docker-compose -f tests/docker-compose.yaml down
diff --git a/plugins/config/plugin.go b/plugins/config/plugin.go
index a5215226..918381c4 100755
--- a/plugins/config/plugin.go
+++ b/plugins/config/plugin.go
@@ -134,9 +134,7 @@ func (v *Viper) Name() string {
}
// Available interface implementation
-func (v *Viper) Available() bool {
- return true
-}
+func (v *Viper) Available() {}
func parseFlag(flag string) (string, string, error) {
const op = errors.Op("parse_flag")
diff --git a/plugins/gzip/plugin.go b/plugins/gzip/plugin.go
index d25894ff..24b125fb 100644
--- a/plugins/gzip/plugin.go
+++ b/plugins/gzip/plugin.go
@@ -22,9 +22,7 @@ func (g *Plugin) Middleware(next http.Handler) http.Handler {
}
// Available interface implementation
-func (g *Plugin) Available() bool {
- return true
-}
+func (g *Plugin) Available() {}
func (g *Plugin) Name() string {
return PluginName
diff --git a/plugins/headers/plugin.go b/plugins/headers/plugin.go
index caba6aeb..19c444df 100644
--- a/plugins/headers/plugin.go
+++ b/plugins/headers/plugin.go
@@ -70,9 +70,7 @@ func (s *Plugin) Name() string {
}
// Available interface implementation
-func (s *Plugin) Available() bool {
- return true
-}
+func (s *Plugin) Available() {}
// configure OPTIONS response
func (s *Plugin) preflightRequest(w http.ResponseWriter) {
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go
index cf6d75fd..344102f4 100644
--- a/plugins/http/plugin.go
+++ b/plugins/http/plugin.go
@@ -442,6 +442,4 @@ func (s *Plugin) Ready() status.Status {
}
// Available interface implementation
-func (s *Plugin) Available() bool {
- return true
-}
+func (s *Plugin) Available() {}
diff --git a/plugins/informer/interface.go b/plugins/informer/interface.go
index 08eda00b..316c7bc1 100644
--- a/plugins/informer/interface.go
+++ b/plugins/informer/interface.go
@@ -16,6 +16,6 @@ type Informer interface {
// Availabler interface should be implemented by every plugin which wish to report to the PHP worker that it available in the RR runtime
type Availabler interface {
- // Available returns true if the particular plugin available in the RR2 runtime
- Available() bool
+ // Available method needed to collect all plugins which are available in the runtime.
+ Available()
}
diff --git a/plugins/kv/drivers/boltdb/plugin.go b/plugins/kv/drivers/boltdb/plugin.go
index eba388c2..9b4cf9f7 100644
--- a/plugins/kv/drivers/boltdb/plugin.go
+++ b/plugins/kv/drivers/boltdb/plugin.go
@@ -65,6 +65,4 @@ func (s *Plugin) Name() string {
}
// Available interface implementation
-func (s *Plugin) Available() bool {
- return true
-}
+func (s *Plugin) Available() {}
diff --git a/plugins/kv/drivers/memcached/plugin.go b/plugins/kv/drivers/memcached/plugin.go
index c95a7f73..cde84f42 100644
--- a/plugins/kv/drivers/memcached/plugin.go
+++ b/plugins/kv/drivers/memcached/plugin.go
@@ -34,9 +34,7 @@ func (s *Plugin) Name() string {
}
// Available interface implementation
-func (s *Plugin) Available() bool {
- return true
-}
+func (s *Plugin) Available() {}
func (s *Plugin) Provide(key string) (kv.Storage, error) {
const op = errors.Op("boltdb_plugin_provide")
diff --git a/plugins/kv/drivers/memory/plugin.go b/plugins/kv/drivers/memory/plugin.go
index fd4ed15f..2be7caae 100644
--- a/plugins/kv/drivers/memory/plugin.go
+++ b/plugins/kv/drivers/memory/plugin.go
@@ -64,6 +64,5 @@ func (s *Plugin) Name() string {
}
// Available interface implementation
-func (s *Plugin) Available() bool {
- return true
+func (s *Plugin) Available() {
}
diff --git a/plugins/kv/storage.go b/plugins/kv/storage.go
index 2f1e0716..fe2fa10b 100644
--- a/plugins/kv/storage.go
+++ b/plugins/kv/storage.go
@@ -186,6 +186,5 @@ func (p *Plugin) Name() string {
}
// Available interface implementation
-func (p *Plugin) Available() bool {
- return true
+func (p *Plugin) Available() {
}
diff --git a/plugins/logger/plugin.go b/plugins/logger/plugin.go
index 1084cc5e..ffbf7f5e 100644
--- a/plugins/logger/plugin.go
+++ b/plugins/logger/plugin.go
@@ -82,6 +82,5 @@ func (z *ZapLogger) Name() string {
}
// Available interface implementation
-func (z *ZapLogger) Available() bool {
- return true
+func (z *ZapLogger) Available() {
}
diff --git a/plugins/metrics/plugin.go b/plugins/metrics/plugin.go
index df6ea122..474bb21d 100644
--- a/plugins/metrics/plugin.go
+++ b/plugins/metrics/plugin.go
@@ -224,6 +224,5 @@ func (m *Plugin) RPC() interface{} {
}
// Available interface implementation
-func (m *Plugin) Available() bool {
- return true
+func (m *Plugin) Available() {
}
diff --git a/plugins/redis/plugin.go b/plugins/redis/plugin.go
index b69af9d6..2eab7043 100644
--- a/plugins/redis/plugin.go
+++ b/plugins/redis/plugin.go
@@ -78,6 +78,5 @@ func (s *Plugin) Name() string {
}
// Available interface implementation
-func (s *Plugin) Available() bool {
- return true
+func (s *Plugin) Available() {
}
diff --git a/plugins/reload/plugin.go b/plugins/reload/plugin.go
index d2c22fe8..7e6bdfec 100644
--- a/plugins/reload/plugin.go
+++ b/plugins/reload/plugin.go
@@ -163,6 +163,5 @@ func (s *Plugin) Name() string {
}
// Available interface implementation
-func (s *Plugin) Available() bool {
- return true
+func (s *Plugin) Available() {
}
diff --git a/plugins/resetter/plugin.go b/plugins/resetter/plugin.go
index a80c2c0f..4feb692a 100644
--- a/plugins/resetter/plugin.go
+++ b/plugins/resetter/plugin.go
@@ -75,8 +75,7 @@ func (p *Plugin) Name() string {
}
// Available interface implementation
-func (p *Plugin) Available() bool {
- return true
+func (p *Plugin) Available() {
}
// RPC returns associated rpc service.
diff --git a/plugins/rpc/plugin.go b/plugins/rpc/plugin.go
index f88aa6de..cfe20321 100644
--- a/plugins/rpc/plugin.go
+++ b/plugins/rpc/plugin.go
@@ -123,8 +123,7 @@ func (s *Plugin) Name() string {
}
// Available interface implementation
-func (s *Plugin) Available() bool {
- return true
+func (s *Plugin) Available() {
}
// Collects all plugins which implement Name + RPCer interfaces
diff --git a/plugins/server/plugin.go b/plugins/server/plugin.go
index 64793034..22b568d8 100644
--- a/plugins/server/plugin.go
+++ b/plugins/server/plugin.go
@@ -59,8 +59,7 @@ func (server *Plugin) Name() string {
}
// Available interface implementation
-func (server *Plugin) Available() bool {
- return true
+func (server *Plugin) Available() {
}
// Serve (Start) server plugin (just a mock here to satisfy interface)
diff --git a/plugins/service/plugin.go b/plugins/service/plugin.go
index 522fe192..28b84443 100644
--- a/plugins/service/plugin.go
+++ b/plugins/service/plugin.go
@@ -106,6 +106,5 @@ func (service *Plugin) Name() string {
}
// Available interface implementation
-func (service *Plugin) Available() bool {
- return true
+func (service *Plugin) Available() {
}
diff --git a/plugins/status/plugin.go b/plugins/status/plugin.go
index 3553bb01..82a0fa6c 100644
--- a/plugins/status/plugin.go
+++ b/plugins/status/plugin.go
@@ -128,9 +128,7 @@ func (c *Plugin) Name() string {
}
// Available interface implementation
-func (c *Plugin) Available() bool {
- return true
-}
+func (c *Plugin) Available() {}
// RPC returns associated rpc service.
func (c *Plugin) RPC() interface{} {
diff --git a/tests/plugins/informer/test_plugin.go b/tests/plugins/informer/test_plugin.go
index db757110..43335999 100644
--- a/tests/plugins/informer/test_plugin.go
+++ b/tests/plugins/informer/test_plugin.go
@@ -49,9 +49,7 @@ func (p1 *Plugin1) Name() string {
return "informer.plugin1"
}
-func (p1 *Plugin1) Available() bool {
- return true
-}
+func (p1 *Plugin1) Available() {}
func (p1 *Plugin1) Workers() []process.State {
p, err := p1.server.NewWorkerPool(context.Background(), testPoolConfig, nil)