mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-16 13:00:40 +08:00
Scaffolding for LREM command
This commit is contained in:
@@ -59,6 +59,9 @@ func (p *plugin) HandleCommand(cmd []string, server interface{}, conn *bufio.Wri
|
||||
case c == "ltrim":
|
||||
handleLTrim(cmd, server.(Server), conn)
|
||||
|
||||
case c == "lrem":
|
||||
handleLRem(cmd, server.(Server), conn)
|
||||
|
||||
case utils.Contains[string]([]string{"lpush", "lpushx"}, c):
|
||||
handleLPush(cmd, server.(Server), conn)
|
||||
|
||||
@@ -313,6 +316,10 @@ func handleLTrim(cmd []string, server Server, conn *bufio.Writer) {
|
||||
conn.Flush()
|
||||
}
|
||||
|
||||
func handleLRem(cmd []string, server Server, conn *bufio.Writer) {
|
||||
// Remove element from list
|
||||
}
|
||||
|
||||
func handleLPush(cmd []string, server Server, conn *bufio.Writer) {
|
||||
if len(cmd) < 3 {
|
||||
conn.Write([]byte(fmt.Sprintf("-Error wrong number of arguments for %s command\r\n\n", strings.ToUpper(cmd[0]))))
|
||||
|
Reference in New Issue
Block a user