File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -29,12 +29,12 @@ import (
29
29
30
30
var (
31
31
masterPool * simpleredis.ConnectionPool
32
- slavePool * simpleredis.ConnectionPool
32
+ replicaPool * simpleredis.ConnectionPool
33
33
)
34
34
35
35
func ListRangeHandler (rw http.ResponseWriter , req * http.Request ) {
36
36
key := mux .Vars (req )["key" ]
37
- list := simpleredis .NewList (slavePool , key )
37
+ list := simpleredis .NewList (replicaPool , key )
38
38
members := HandleError (list .GetAll ()).([]string )
39
39
membersJSON := HandleError (json .MarshalIndent (members , "" , " " )).([]byte )
40
40
rw .Write (membersJSON )
@@ -76,8 +76,8 @@ func HandleError(result interface{}, err error) (r interface{}) {
76
76
func main () {
77
77
masterPool = simpleredis .NewConnectionPoolHost ("redis-master:6379" )
78
78
defer masterPool .Close ()
79
- slavePool = simpleredis .NewConnectionPoolHost ("redis-slave:6379" )
80
- defer slavePool .Close ()
79
+ replicaPool = simpleredis .NewConnectionPoolHost ("redis-slave:6379" )
80
+ defer replicaPool .Close ()
81
81
82
82
r := mux .NewRouter ()
83
83
r .Path ("/lrange/{key}" ).Methods ("GET" ).HandlerFunc (ListRangeHandler )
You can’t perform that action at this time.
0 commit comments