mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-05 07:56:52 +08:00
Renamed *AccessKey type to better represent the response on *KeyExtractionFunc types
This commit is contained in:
@@ -20,33 +20,33 @@ import (
|
||||
"github.com/echovault/echovault/internal"
|
||||
)
|
||||
|
||||
func setRangeKeyFunc(cmd []string) (internal.AccessKeys, error) {
|
||||
func setRangeKeyFunc(cmd []string) (internal.KeyExtractionFuncResult, error) {
|
||||
if len(cmd) != 4 {
|
||||
return internal.AccessKeys{}, errors.New(constants.WrongArgsResponse)
|
||||
return internal.KeyExtractionFuncResult{}, errors.New(constants.WrongArgsResponse)
|
||||
}
|
||||
return internal.AccessKeys{
|
||||
return internal.KeyExtractionFuncResult{
|
||||
Channels: make([]string, 0),
|
||||
ReadKeys: make([]string, 0),
|
||||
WriteKeys: cmd[1:2],
|
||||
}, nil
|
||||
}
|
||||
|
||||
func strLenKeyFunc(cmd []string) (internal.AccessKeys, error) {
|
||||
func strLenKeyFunc(cmd []string) (internal.KeyExtractionFuncResult, error) {
|
||||
if len(cmd) != 2 {
|
||||
return internal.AccessKeys{}, errors.New(constants.WrongArgsResponse)
|
||||
return internal.KeyExtractionFuncResult{}, errors.New(constants.WrongArgsResponse)
|
||||
}
|
||||
return internal.AccessKeys{
|
||||
return internal.KeyExtractionFuncResult{
|
||||
Channels: make([]string, 0),
|
||||
ReadKeys: cmd[1:2],
|
||||
WriteKeys: make([]string, 0),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func subStrKeyFunc(cmd []string) (internal.AccessKeys, error) {
|
||||
func subStrKeyFunc(cmd []string) (internal.KeyExtractionFuncResult, error) {
|
||||
if len(cmd) != 4 {
|
||||
return internal.AccessKeys{}, errors.New(constants.WrongArgsResponse)
|
||||
return internal.KeyExtractionFuncResult{}, errors.New(constants.WrongArgsResponse)
|
||||
}
|
||||
return internal.AccessKeys{
|
||||
return internal.KeyExtractionFuncResult{
|
||||
Channels: make([]string, 0),
|
||||
ReadKeys: cmd[1:2],
|
||||
WriteKeys: make([]string, 0),
|
||||
|
Reference in New Issue
Block a user