mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-24 22:46:41 +08:00
Add a custom command config(conf/command.conf)
This commit is contained in:
parent
edbe04b818
commit
e290f27745
@ -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 <list-key>
|
||||
# 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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
108
conf/command.conf.sample
Normal file
108
conf/command.conf.sample
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user