Skip to content

Commit 922c601

Browse files
committed
coding..
1 parent ae57587 commit 922c601

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

goredis_proxy/goredis_proxy_config.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
// 配置Proxy
1010
// > config master localhost:6379
1111
// > config slave localhost:6379
12-
// > config mode rw/rrw
12+
// > config mode r/rr/rw/rrw
1313
func (server *GoRedisProxy) OnCONFIG(session *Session, cmd *Command) (reply *Reply) {
1414
if cmd.Len() < 3 {
1515
return ErrorReply("bad command")
@@ -64,6 +64,11 @@ func (server *GoRedisProxy) resetSlave(host string) (err error) {
6464
return
6565
}
6666

67+
// 包含w表示可写入,包容rr表示主从均可以读
68+
// mode=r, 从库提供读,写操作返回错误
69+
// mode=rr, 主从均提供读,写操作返回错误
70+
// mode=rw, 主库提供写,从库提供读
71+
// mode=rrw,主库提供写,主从均提供读
6772
func (server *GoRedisProxy) resetMode(mode string) (err error) {
6873
server.Suspend()
6974
defer server.Resume()

goredis_proxy/options.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import (
55
"strings"
66
)
77

8-
// Mode=r, 从库提供读,写操作返回错误
9-
// Mode=rr, 主从均提供读,写操作返回错误
10-
// Mode=rw, 主库提供写,从库提供读
11-
// Mode=rrw,主库提供读写,从库提供读
128
type Options struct {
139
MasterHost string
1410
SlaveHost string

0 commit comments

Comments
 (0)