-
Notifications
You must be signed in to change notification settings - Fork 508
Expand file tree
/
Copy pathdriver.go
More file actions
53 lines (43 loc) · 1.66 KB
/
driver.go
File metadata and controls
53 lines (43 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package redis
import "github.com/mediocregopher/radix/v4"
// Errors that may be raised during config parsing.
type RedisError string
func (e RedisError) Error() string {
return string(e)
}
// Interface for a redis client.
type Client interface {
// DoCmd is used to perform a redis command and retrieve a result.
//
// @param rcv supplies receiver for the result.
// @param cmd supplies the command to append.
// @param key supplies the key to append.
// @param args supplies the additional arguments.
DoCmd(rcv interface{}, cmd, key string, args ...interface{}) error
// PipeAppend append a command onto the pipeline queue.
//
// @param pipeline supplies the queue for pending commands.
// @param rcv supplies receiver for the result.
// @param cmd supplies the command to append.
// @param key supplies the key to append.
// @param args supplies the additional arguments.
PipeAppend(pipeline Pipeline, rcv interface{}, cmd, key string, args ...interface{}) Pipeline
// PipeDo writes multiple commands to a Conn in
// a single write, then reads their responses in a single read. This reduces
// network delay into a single round-trip.
//
// @param pipeline supplies the queue for pending commands.
PipeDo(pipeline Pipeline) error
// Once Close() is called all future method calls on the Client will return
// an error
Close() error
// NumActiveConns return number of active connections, used in testing.
NumActiveConns() int
}
// PipelineAction represents a single action in the pipeline along with its key.
// The key is used for grouping commands in cluster mode.
type PipelineAction struct {
Action radix.Action
Key string
}
type Pipeline []PipelineAction