mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-18 22:04:41 +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":
|
case c == "lset":
|
||||||
handleLSet(cmd, server.(Server), conn)
|
handleLSet(cmd, server.(Server), conn)
|
||||||
|
|
||||||
|
case c == "ltrim":
|
||||||
|
handleLTrim(cmd, server.(Server), conn)
|
||||||
|
|
||||||
case utils.Contains[string]([]string{"lpush", "lpushx"}, c):
|
case utils.Contains[string]([]string{"lpush", "lpushx"}, c):
|
||||||
handleLPush(cmd, server.(Server), conn)
|
handleLPush(cmd, server.(Server), conn)
|
||||||
|
|
||||||
@@ -256,6 +259,10 @@ func handleLSet(cmd []string, server Server, conn *bufio.Writer) {
|
|||||||
conn.Flush()
|
conn.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func handleLTrim(cmd []string, server Server, conn *bufio.Writer) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func handleLPush(cmd []string, server Server, conn *bufio.Writer) {
|
func handleLPush(cmd []string, server Server, conn *bufio.Writer) {
|
||||||
if len(cmd) < 3 {
|
if len(cmd) < 3 {
|
||||||
conn.Write([]byte(fmt.Sprintf("-Error wrong number of arguments for %s command\r\n\n", strings.ToUpper(cmd[0]))))
|
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