summaryrefslogtreecommitdiff
path: root/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'interfaces')
-rwxr-xr-xinterfaces/config/interface.go19
-rw-r--r--interfaces/redis/interface.go10
2 files changed, 29 insertions, 0 deletions
diff --git a/interfaces/config/interface.go b/interfaces/config/interface.go
new file mode 100755
index 00000000..00010eae
--- /dev/null
+++ b/interfaces/config/interface.go
@@ -0,0 +1,19 @@
+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/interfaces/redis/interface.go b/interfaces/redis/interface.go
new file mode 100644
index 00000000..61dd6c08
--- /dev/null
+++ b/interfaces/redis/interface.go
@@ -0,0 +1,10 @@
+package redis
+
+import "github.com/go-redis/redis/v8"
+
+type Redis interface {
+ GetClient() *redis.Client
+ GetUniversalClient() *redis.UniversalClient
+ GetClusterClient() *redis.ClusterClient
+ GetSentinelClient() *redis.SentinelClient
+}