Documentation ¶
Index ¶
- func ConvertToStringValues(value interface{}) string
- type RedisCacheClient
- type RedisClient
- func (r *RedisClient) Get(ctx context.Context, key string) ([]byte, error)
- func (r *RedisClient) GetListValues(ctx context.Context, listKey string, values int) ([]interface{}, error)
- func (r *RedisClient) GetMatchingKeys(ctx context.Context, pattern string) ([]string, error)
- func (r *RedisClient) Ping() error
- func (r *RedisClient) PublishMessageToChannel(ctx context.Context, channel string, message []byte) error
- func (r *RedisClient) PushToList(ctx context.Context, listKey string, value []byte) error
- func (r *RedisClient) RemoveFromList(ctx context.Context, listKey string, value []byte) (int64, error)
- func (r *RedisClient) Set(ctx context.Context, key string, value []byte, timeout int) error
- func (r *RedisClient) Subscribe(ctx context.Context, channels []string) (*redis.PubSubConn, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToStringValues ¶
func ConvertToStringValues(value interface{}) string
Types ¶
type RedisCacheClient ¶
type RedisCacheClient interface { Ping() error //Get Get(ctx context.Context, key string) ([]byte, error) GetMatchingKeys(ctx context.Context, pattern string) ([]string, error) GetListValues(ctx context.Context, listKey string, values int) ([]interface{}, error) //Set Set(ctx context.Context, key string, value []byte, timeout int) error PushToList(ctx context.Context, listKey string, value []byte) error //Remove RemoveFromList(ctx context.Context, listKey string, value []byte) (int64, error) //PubSub PublishMessageToChannel(ctx context.Context, channel string, message []byte) error Subscribe(ctx context.Context, channels []string) (*redis.PubSubConn, error) }
func ReturnRedisClient ¶
func ReturnRedisClient() (RedisCacheClient, error)
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
func (*RedisClient) Get ¶
Get will search for a key and return the data found If no data is found, will return nil
func (*RedisClient) GetListValues ¶
func (*RedisClient) GetMatchingKeys ¶
GetKeys will check for a pattern and retrieve keys matching the pattern
func (*RedisClient) PublishMessageToChannel ¶
func (*RedisClient) PushToList ¶
func (*RedisClient) RemoveFromList ¶
func (*RedisClient) Subscribe ¶
func (r *RedisClient) Subscribe(ctx context.Context, channels []string) (*redis.PubSubConn, error)
Click to show internal directories.
Click to hide internal directories.