summaryrefslogtreecommitdiff
path: root/plugins/redis/plugin.go
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/redis/plugin.go
parent7884349f27ed750825a0f4dea59af8964e182651 (diff)
Move config interface to the interfaces folder. Initial redis plugin
structure
Diffstat (limited to 'plugins/redis/plugin.go')
-rw-r--r--plugins/redis/plugin.go55
1 files changed, 55 insertions, 0 deletions
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
+}