Skip to content

Commit

Permalink
Merge pull request #34 from matiasinsaurralde/master
Browse files Browse the repository at this point in the history
#33 strlen!
  • Loading branch information
hoisie committed Jan 26, 2014
2 parents 506c7e7 + 24e4c60 commit a1b3347
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,16 @@ func (client *Client) Substr(key string, start int, end int) ([]byte, error) {
return data, nil
}

func (client *Client) Strlen(key string) (int, error) {
res, err := client.sendCommand("STRLEN", key)
if err != nil {
return -1, err
}

return int(res.(int64)), nil
}


// List commands

func (client *Client) Rpush(key string, val []byte) error {
Expand Down

0 comments on commit a1b3347

Please sign in to comment.