Change custom command default mode to Write

This commit is contained in:
Yoon 2018-04-09 12:48:30 +09:00
parent 2d93868e82
commit a0a9d818df
2 changed files with 11 additions and 3 deletions

View File

@ -10,35 +10,40 @@ CustomCommand {
# Currently support only 1 key with first argument. # Currently support only 1 key with first argument.
minArgs 3 # minimum arguments(including command itself), default is 2(key only) minArgs 3 # minimum arguments(including command itself), default is 2(key only)
maxArgs 3 # maximum arguments(including command itself), default is 2(key only) maxArgs 3 # maximum arguments(including command itself), default is 2(key only)
mode Read,Write # a command mode Read/Write/Admin is exclusive, Conf.cpp should check this. mode Read,Write # a command mode Read/Write/Admin is exclusive, default is Write
# default is Read, Write
} }
# hello.repl2 <list-key> # hello.repl2 <list-key>
# just skipped since minArgs = 2, maxArgs = 2, mode = Read,Write are default values # just skipped since minArgs = 2, maxArgs = 2, mode = Read,Write are default values
hello.repl2 { hello.repl2 {
mode Read,Write
} }
# hello.toggle.case key # hello.toggle.case key
hello.toggle.case { hello.toggle.case {
mode Read,Write
} }
# hello.more.expire key milliseconds # hello.more.expire key milliseconds
hello.more.expire { hello.more.expire {
minArgs 3 minArgs 3
maxArgs 3 maxArgs 3
mode Read,Write
} }
# hello.zsumrange key startscore endscore # hello.zsumrange key startscore endscore
hello.zsumrange { hello.zsumrange {
minArgs 4 minArgs 4
maxArgs 4 maxArgs 4
mode Read,Write
} }
# hello.lexrange key min_lex max_lex min_age max_age # hello.lexrange key min_lex max_lex min_age max_age
hello.lexrange { hello.lexrange {
minArgs 6 minArgs 6
maxArgs 6 maxArgs 6
mode Read,Write
} }
# hello.hcopy key srcfield dstfield # hello.hcopy key srcfield dstfield
hello.hcopy { hello.hcopy {
minArgs 4 minArgs 4
maxArgs 4 maxArgs 4
mode Read,Write
} }
# from redis source src/modules/hellotype.c # from redis source src/modules/hellotype.c
@ -46,13 +51,16 @@ CustomCommand {
hello.insert { hello.insert {
minArgs 3 minArgs 3
maxArgs 3 maxArgs 3
mode Read,Write
} }
# hellotype.range key first count # hellotype.range key first count
hellotype.range { hellotype.range {
minArgs 4 minArgs 4
maxArgs 4 maxArgs 4
mode Read,Write
} }
# hellotype.len key # hellotype.len key
hello.len { hello.len {
mode Read,Write
} }
} }

View File

@ -39,7 +39,7 @@ void CustomCommandConf::init(CustomCommandConf&c, const char* name, const int ty
c.cmd.name = c.name.c_str(); c.cmd.name = c.name.c_str();
c.cmd.minArgs = 2; c.cmd.minArgs = 2;
c.cmd.maxArgs = 2; c.cmd.maxArgs = 2;
c.cmd.mode = Command::Write|Command::Read; c.cmd.mode = Command::Write;
} }
Conf::Conf(): Conf::Conf():