Documentation
¶
Index ¶
- type RedisStore
- func (s *RedisStore) BLMOVE(ctx context.Context, source string, destination string) (string, error)
- func (s *RedisStore) BRPop(ctx context.Context, key string) (string, error)
- func (s *RedisStore) Delete(ctx context.Context, key string) error
- func (s *RedisStore) Exists(ctx context.Context, key string) (bool, error)
- func (s *RedisStore) Get(ctx context.Context, key string) (string, error)
- func (s *RedisStore) LPush(ctx context.Context, key string, value interface{}) error
- func (s *RedisStore) LREM(ctx context.Context, key string, count int64, value interface{}) error
- func (s *RedisStore) Publish(ctx context.Context, channel string, message interface{}) error
- func (s *RedisStore) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
- func (s *RedisStore) Subscribe(ctx context.Context, channel string) (<-chan *redis.Message, error)
- func (s *RedisStore) SubscribeLog(ctx context.Context) (<-chan *redis.Message, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RedisStore ¶
func NewRedisStore ¶
func NewRedisStore(addr string, password string, db int) (*RedisStore, error)
func (*RedisStore) BLMOVE ¶
Create a BLMOVE method that will move an element from a list to another list atomically
func (*RedisStore) BRPop ¶
Create a BRPOP/BLPOP method that will remove and return the first element of a list
func (*RedisStore) Delete ¶
func (s *RedisStore) Delete(ctx context.Context, key string) error
Delete removes a key-value pair from the store
func (*RedisStore) LPush ¶
func (s *RedisStore) LPush(ctx context.Context, key string, value interface{}) error
Create a LPUSH method that will add a message to a list
func (*RedisStore) LREM ¶
Create a LREM method that will remove the first count occurrences of elements equal to value from the list stored at key
func (*RedisStore) Publish ¶
func (s *RedisStore) Publish(ctx context.Context, channel string, message interface{}) error
Implement your pub/sub methods here Publish sends a message to a channel
func (*RedisStore) Set ¶
func (s *RedisStore) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
Set adds a key-value pair to the store
func (*RedisStore) Subscribe ¶
Subscribe subscribes to a channel and returns a channel that receives messages
func (*RedisStore) SubscribeLog ¶
Create a Subscribe method that log all messages received from the channel