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

@@ -426,3 +426,21 @@ func init() {
RegisterCommand("RenameNx", execRenameNx, prepareRename, undoRename, 3, flagReadOnly)
RegisterCommand("Keys", execKeys, noPrepare, nil, 2, flagReadOnly)
}
func init() {
RegisterGodisCommand("Del", -2, []string{Write}, 1, -1, 1, writeAllKeys)
RegisterGodisCommand("Expire", 3, []string{Write, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("ExpireAt", 3, []string{Write, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("ExpireTime", 2, []string{Write, Fast}, 1, 1, 1, readFirstKey)
RegisterGodisCommand("PExpire", 3, []string{Write, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("PExpireAt", 3, []string{Write, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("PExpireTime", 2, []string{Write, Fast}, 1, 1, 1, readFirstKey)
RegisterGodisCommand("TTL", 2, []string{Readonly, Random, Fast}, 1, 1, 1, readFirstKey)
RegisterGodisCommand("PTTL", 2, []string{Readonly, Random, Fast}, 1, 1, 1, readFirstKey)
RegisterGodisCommand("Persist", 2, []string{Write, Fast}, 1, 1, 1, writeFirstKey)
RegisterGodisCommand("Exists", -2, []string{Readonly, Fast}, 1, 1, 1, readAllKeys)
RegisterGodisCommand("Type", 2, []string{Readonly, Fast}, 1, 1, 1, readFirstKey)
RegisterGodisCommand("Rename", 3, []string{Write}, 1, 1, 1, prepareRename)
RegisterGodisCommand("RenameNx", 3, []string{Write, Fast}, 1, 1, 1, prepareRename)
RegisterGodisCommand("Keys", 2, []string{Readonly, SortForScript}, 1, 1, 1, nil)
}