mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-16 13:00:40 +08:00
Created handler for LTRIM command
This commit is contained in:
@@ -56,6 +56,9 @@ func (p *plugin) HandleCommand(cmd []string, server interface{}, conn *bufio.Wri
|
||||
case c == "lset":
|
||||
handleLSet(cmd, server.(Server), conn)
|
||||
|
||||
case c == "ltrim":
|
||||
handleLTrim(cmd, server.(Server), conn)
|
||||
|
||||
case utils.Contains[string]([]string{"lpush", "lpushx"}, c):
|
||||
handleLPush(cmd, server.(Server), conn)
|
||||
|
||||
@@ -256,6 +259,10 @@ func handleLSet(cmd []string, server Server, conn *bufio.Writer) {
|
||||
conn.Flush()
|
||||
}
|
||||
|
||||
func handleLTrim(cmd []string, server Server, conn *bufio.Writer) {
|
||||
|
||||
}
|
||||
|
||||
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