示例#1
0
文件: zset.go 项目: lunny/gossdb
func (this *Client) Zincr(setName string, key string, num int64) (int64, error) {
	if len(key) == 0 {
		return 0, nil
	}
	resp, err := this.Do("zincr", setName, key, this.encoding(num, false))
	if err != nil {
		return 0, goerr.NewError(err, "Zincr %s %s %v", setName, key, num)
	}

	if len(resp) > 1 && resp[0] == "ok" {
		return to.Int64(resp[1]), nil
	}
	return 0, makeError(resp, setName, key)
}
示例#2
0
文件: value.go 项目: lunny/gossdb
//返回 int64 的值
func (this Value) Int64() int64 {
	return to.Int64(this)
}