Documentation ¶
Overview ¶
Package redis implements a Redis client which compatible with cache.Storage.
Index ¶
- type Option
- type Redis
- func (c *Redis) Delete(key string) error
- func (c *Redis) Expire(key string, expiration time.Duration) (bool, error)
- func (c *Redis) Incr(key string) (int64, error)
- func (c *Redis) Name() string
- func (c *Redis) Read(key string) ([]byte, error)
- func (c *Redis) ReadMulti(keys []string) (map[string][]byte, error)
- func (c *Redis) Write(key string, value []byte, expiration time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option struct { Addrs []string Password string // A database to be selected after connecting to server. // Redis Cluster ignores this value. DB int // Cluster specific flag to enable read-only commands on slave nodes. ReadOnly bool // Sentinel specific flag to set master name. MasterName string MaxRetries int IdleTimeout time.Duration }
Option represents configurable configuration for redis client.
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis is a Redis client representing a pool of zero or more underlying connections. It's saafe for concurrent use by multiple goroutines.
Click to show internal directories.
Click to hide internal directories.