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 /interfaces | |
parent | 7884349f27ed750825a0f4dea59af8964e182651 (diff) |
Move config interface to the interfaces folder. Initial redis plugin
structure
Diffstat (limited to 'interfaces')
-rwxr-xr-x | interfaces/config/interface.go | 19 | ||||
-rw-r--r-- | interfaces/redis/interface.go | 10 |
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 +} |