diff --git a/conf/command.conf b/conf/command.conf index d3704b8..22ddd4f 100644 --- a/conf/command.conf +++ b/conf/command.conf @@ -10,35 +10,40 @@ CustomCommand { # Currently support only 1 key with first argument. minArgs 3 # minimum 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. - # default is Read, Write + mode Read,Write # a command mode Read/Write/Admin is exclusive, default is Write } # hello.repl2 # just skipped since minArgs = 2, maxArgs = 2, mode = Read,Write are default values hello.repl2 { + mode Read,Write } # hello.toggle.case key hello.toggle.case { + mode Read,Write } # hello.more.expire key milliseconds hello.more.expire { minArgs 3 maxArgs 3 + mode Read,Write } # hello.zsumrange key startscore endscore hello.zsumrange { minArgs 4 maxArgs 4 + mode Read,Write } # hello.lexrange key min_lex max_lex min_age max_age hello.lexrange { minArgs 6 maxArgs 6 + mode Read,Write } # hello.hcopy key srcfield dstfield hello.hcopy { minArgs 4 maxArgs 4 + mode Read,Write } # from redis source src/modules/hellotype.c @@ -46,13 +51,16 @@ CustomCommand { hello.insert { minArgs 3 maxArgs 3 + mode Read,Write } # hellotype.range key first count hellotype.range { minArgs 4 maxArgs 4 + mode Read,Write } # hellotype.len key hello.len { + mode Read,Write } } diff --git a/src/Conf.cpp b/src/Conf.cpp index 44dd0e9..4547b21 100644 --- a/src/Conf.cpp +++ b/src/Conf.cpp @@ -39,7 +39,7 @@ void CustomCommandConf::init(CustomCommandConf&c, const char* name, const int ty c.cmd.name = c.name.c_str(); c.cmd.minArgs = 2; c.cmd.maxArgs = 2; - c.cmd.mode = Command::Write|Command::Read; + c.cmd.mode = Command::Write; } Conf::Conf():