diff --git a/conf/command.conf b/conf/command.conf index d966f6a..0e06a56 100644 --- a/conf/command.conf +++ b/conf/command.conf @@ -1,93 +1,66 @@ +# CustomCommand section must be defined before Latency monitor to support all commands +# +# NOTE: only support maximum 16 custom commands + CustomCommand { - # - hello.simple { - minArgs 3 - maxArgs 3 - mode Read + # from redis source src/modules/hello.c + # hello.push.native key value + hello.push.native { # name of command, must be lowercase. + # key parameter is located at first argument. i.e. command key ... + # 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 # behavior or permission. Currently support Read, Write, Admin } - # - hello.push.native { - minArgs 3 - maxArgs 3 - mode Read - } - # - hello.push.call { - minArgs 3 - maxArgs 3 - mode Read - } - # - hello.push.call2 { - minArgs 3 - maxArgs 3 - mode Read - } - # - hello.list.sumlen { - minArgs 3 - maxArgs 3 - mode Read - } - # - hello.list.splice { - minArgs 3 - maxArgs 3 - mode Read - } - # - hello.list.splice.auto { - minArgs 3 - maxArgs 3 - mode Read - } - # - hello.ran.array { - minArgs 3 - maxArgs 3 - mode Read - } - # - hello.repl1 { - minArgs 3 - maxArgs 3 - mode Read - } - # + # hello.repl2 + # just skipped since minArgs = 2, maxArgs = 2 are default values hello.repl2 { - minArgs 3 - maxArgs 3 - mode Read + mode Read,Write } - # + # hello.toggle.case key hello.toggle.case { - minArgs 3 - maxArgs 3 - mode Read + mode Read,Write } - # + # hello.more.expire key milliseconds hello.more.expire { minArgs 3 maxArgs 3 - mode Read + 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 3 - maxArgs 3 - mode Read + minArgs 6 + maxArgs 6 + mode Read,Write } - # + # hello.hcopy key srcfield dstfield hello.hcopy { - minArgs 3 - maxArgs 3 - mode Read + minArgs 4 + maxArgs 4 + mode Read,Write } - # - hello.leftpad { + + # from redis source src/modules/hellotype.c + # hellotype.insert key value + hello.insert { minArgs 3 maxArgs 3 - mode Read + mode Read,Write + } + # hellotype.range key first count + hellotype.range { + minArgs 4 + maxArgs 4 + mode Read,Write + } + # hellotype.len key + hello.len { + mode Read,Wrie } } - diff --git a/conf/command.conf.sample b/conf/command.conf.sample new file mode 100644 index 0000000..6ca0abb --- /dev/null +++ b/conf/command.conf.sample @@ -0,0 +1,108 @@ +CustomCommand { + # + hello.simple { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.push.native { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.push.call { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.push.call2 { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.list.sumlen { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.list.splice { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.list.splice.auto { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.ran.array { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.repl1 { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.repl2 { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.toggle.case { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.more.expire { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.lexrange { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.hcopy { + minArgs 3 + maxArgs 3 + mode Read + } + # + hello.leftpad { + minArgs 3 + maxArgs 3 + mode Read + } + # hellotype.insert key value + hello.insert { + minArgs 3 + maxArgs 3 + } + # hellotype.range key first count + hellotype.range { + minArgs 4 + maxArgs 4 + mode Read + } + # hellotype.len key + hello.len { + mode Read + } +} + diff --git a/conf/predixy.conf b/conf/predixy.conf index 6f4be1d..ae50895 100644 --- a/conf/predixy.conf +++ b/conf/predixy.conf @@ -95,10 +95,9 @@ Include try.conf ################################### LATENCY #################################### ## Custom command define, see command.conf -## must defined before Latency monitor +## must defined before Latency monitor define #Include command.conf - ################################### LATENCY #################################### ## Latency monitor define, see latency.conf Include latency.conf