Documentation ¶
Overview ¶
Reference: https://github.com/astaxie/goredis
Index ¶
- type Client
- func (client *Client) Auth(password string) error
- func (client *Client) Close() error
- func (client *Client) Do(cmd string, args ...string) (interface{}, error)
- func (client *Client) Get(key string) ([]byte, error)
- func (client *Client) GetEx(key string, timeout time.Duration) ([]byte, error)
- func (client *Client) Publish(channel, val string) error
- func (client *Client) Set(key, val string) error
- func (client *Client) SetEx(key, val string, timeout time.Duration) error
- func (client *Client) Subscribe(subscribe <-chan string, unsubscribe <-chan string, psubscribe <-chan string, ...) error
- func (client *Client) Ttl(key string) (int64, error)
- type Message
- type RedisError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Subscribe ¶
func (client *Client) Subscribe(subscribe <-chan string, unsubscribe <-chan string, psubscribe <-chan string, punsubscribe <-chan string, messages chan<- Message) error
Subscribe to redis serve channels, this method will block until one of the sub/unsub channels are closed. There are two pairs of channels subscribe/unsubscribe & psubscribe/punsubscribe. The former does an exact match on the channel, the later uses glob patterns on the redis channels. Closing either of these channels will unblock this method call. Messages that are received are sent down the messages channel.
type Message ¶
Container for messages received from publishers on channels that we're subscribed to.
type RedisError ¶
type RedisError string
func (RedisError) Error ¶
func (err RedisError) Error() string
Click to show internal directories.
Click to hide internal directories.