support Command command

This commit is contained in:
suger-no
2023-04-20 13:01:26 +08:00
committed by finley
parent a3326d2bba
commit 25bbd82da5
9 changed files with 298 additions and 0 deletions

View File

@@ -524,3 +524,18 @@ func init() {
RegisterCommand("LSet", execLSet, writeFirstKey, undoLSet, 4, flagWrite)
RegisterCommand("LRange", execLRange, readFirstKey, nil, 4, flagReadOnly)
}
func init() {
RegisterGodisCommand("LPush", -3, []string{Write, Denyoom, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("LPushX", -3, []string{Write, Denyoom, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("RPush", -3, []string{Write, Denyoom, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("RPushX", -3, []string{Write, Denyoom, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("LPop", 2, []string{Write, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("RPop", 2, []string{Write, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("RPopLPush", 3, []string{Write, Denyoom}, 1, 1, 1, prepareRPopLPush)
RegisterGodisCommand("LRem", 4, []string{Write}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("LLen", 2, []string{Readonly, Fast}, 1, 1, 1, readFirstKey)
RegisterGodisCommand("LIndex", 3, []string{Readonly}, 1, 1, 1, readFirstKey)
RegisterGodisCommand("LSet", 4, []string{Write, Denyoom}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("LRange", 4, []string{Readonly}, 1, 1, 1, readFirstKey)
}