Del deletes a key-value pair from the db by client api
(key string)
| 74 | |
| 75 | // Del deletes a key-value pair from the db by client api |
| 76 | func (c *Client) Del(key string) error { |
| 77 | client, err := newGrpcClient(c.Addr) |
| 78 | if err != nil { |
| 79 | return err |
| 80 | } |
| 81 | del, err := client.Del(context.Background(), &gstring.DelRequest{Key: key}) |
| 82 | if err != nil { |
| 83 | return err |
| 84 | } |
| 85 | if !del.Ok { |
| 86 | return errors.New("del failed") |
| 87 | } |
| 88 | return nil |
| 89 | } |
| 90 | |
| 91 | func (c *Client) StrLen(key string) (int32, error) { |
| 92 | client, err := newGrpcClient(c.Addr) |
nothing calls this directly
no test coverage detected