Documentation
¶
Index ¶
Constants ¶
const (
ERROR_REDIS_INSTANCE = "redis_connection : failed to get the redis client"
)
Variables ¶
This section is empty.
Functions ¶
func CloseRedisClient ¶
func CloseRedisClient(temp *RedisClientId)
ClosePubsubClient used to close the pubsub client instance
func CreateRedisClient ¶
func CreateRedisClient(temp *RedisClient)
CreateRedisClient used to create a new RedisClient connection
func GetRedisClient ¶
func GetRedisClient(temp *RedisClientId) (*redis.Client, error)
GetRedisClient used to get the redis client connection id
Types ¶
type RedisClient ¶
type RedisClient struct { Id *RedisClientId Once *sync.Once Opts *redis.Options Err *error // contains filtered or unexported fields }
RedisClient Id -> Unique Id for Redis Client
example : "test-connection-1"
Hostname -> Redis Host name Password -> Redis Password DB -> Redis DB Once -> Singleton mutex
type RedisClientId ¶
type RedisClientId struct {
Id string
}
RedisClientId Id -> should have same Id as RedisClient instance Id
type RedisClients ¶
type RedisClients struct {
// contains filtered or unexported fields
}
RedisClients all_clients -> all redis connection details
type Service ¶
type Service struct{}
func (*Service) DeleteKey ¶
This method returns the value if key present in redis else returns error object.
func (*Service) GetJSON ¶
This method returns the value if key present in redis else returns error object.
func (*Service) GetKV ¶
This method returns the value if key present in redis else returns error object.