Documentation ¶
Overview ¶
Package redis implements a client for Redis.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrProtocol = errors.New("go.redis: protocol error")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Addr string // Server Address like "127.0.0.1:6379" or "/run/redis.sock" Proto string // Server Protocol like "tcp" or "unix" PoolSize uint // Connection Pool Size, must be specified Timeout time.Duration // Timeout per call Stats Stats // For Stats collection // contains filtered or unexported fields }
Client implements a Redis connection which is what you should typically use instead of the lower level Conn interface. It implements a fixed size connection pool and supports per-call timeout.
func ClientFlag ¶
Define a Client via flag parameters. For example if name is "redis", it will provide:
-redis.proto=unix -redis.addr=/run/redis.sock -redis.pool-size=10 -redis.timeout=1s
type Conn ¶
type Conn interface { // Write accepts any redis command and arbitrary list of arguments. // // Write("SET", "counter", 1) // Write("INCR", "counter") // // Write might return a net.Conn.Write error Write(args ...interface{}) error // Read a single reply from the connection. If there is no reply waiting // this method will block. Read() (*Reply, error) // Close the Connection. Close() error // Returns the underlying net.Conn. This is useful for example to set // set a r/w deadline on the connection. // // conn.Sock().SetDeadline(t) Sock() net.Conn }
Represents a Connection to the server and abstracts the read/write via a connection.
Directories ¶
Path | Synopsis |
---|---|
package bufin implements a partially static buffed input reader.
|
package bufin implements a partially static buffed input reader. |
Package bytecache provides a redis backed bytecache.
|
Package bytecache provides a redis backed bytecache. |
Package bytestore provides a redis backed bytestore.
|
Package bytestore provides a redis backed bytestore. |
Package redistest provides test redis server support.
|
Package redistest provides test redis server support. |
Click to show internal directories.
Click to hide internal directories.