mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-05 07:56:52 +08:00
feat: INCR command added
This commit is contained in:
@@ -16,6 +16,7 @@ package generic
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/echovault/echovault/internal"
|
||||
"github.com/echovault/echovault/internal/constants"
|
||||
)
|
||||
@@ -135,3 +136,12 @@ func expireAtKeyFunc(cmd []string) (internal.KeyExtractionFuncResult, error) {
|
||||
WriteKeys: cmd[1:2],
|
||||
}, nil
|
||||
}
|
||||
|
||||
func incrKeyFunc(cmd []string) (internal.KeyExtractionFuncResult, error) {
|
||||
if len(cmd) != 2 {
|
||||
return internal.KeyExtractionFuncResult{}, errors.New("wrong number of arguments for INCR")
|
||||
}
|
||||
return internal.KeyExtractionFuncResult{
|
||||
WriteKeys: cmd[1:2],
|
||||
}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user