Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
xgzlucario committed Nov 1, 2023
1 parent 3e6d6ed commit ac0d7ef
Show file tree
Hide file tree
Showing 3 changed files with 468 additions and 442 deletions.
2 changes: 2 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package rotom

import (
"errors"
"fmt"
"net"
"time"

Expand Down Expand Up @@ -129,6 +130,7 @@ func (c *Client) SHas(key, item string) (bool, error) {
if err != nil {
return false, err
}
fmt.Println(args[0])
return args[0] == _true, nil
}

Expand Down
2 changes: 2 additions & 0 deletions rotom.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ var cmdTable = []Cmd{
}},
// set
{OpSAdd, 2, func(e *Engine, args [][]byte, _ base.Writer) error {
fmt.Println("hook SAdd", string(args[0]), string(args[1]))
// key, item
return e.SAdd(*b2s(args[0]), *b2s(args[1]))
}},
Expand All @@ -211,6 +212,7 @@ var cmdTable = []Cmd{
if err != nil {
return err
}
fmt.Println("hook SHas", string(args[0]), string(args[1]), ok)
return w.WriteByte(bool2byte(ok))
}},
{OpSCard, 1, func(e *Engine, args [][]byte, w base.Writer) error {
Expand Down
Loading

0 comments on commit ac0d7ef

Please sign in to comment.