本文整理匯總了Golang中github.com/redigo/redis.Int函數的典型用法代碼示例。如果您正苦於以下問題:Golang Int函數的具體用法?Golang Int怎麽用?Golang Int使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Int函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ZInterStore
//ZINTERSTORE destination numkeys key
func (r *RedisType) ZInterStore(destination, key string, numkeys int, weight ...interface{}) (int, error) {
if len(weight) > 0 {
row, err := redis.Int(r.RedisConn.Do("ZINTERSTORE", destination, key, numkeys, weight))
return row, err
}
row, err := redis.Int(r.RedisConn.Do("ZINTERSTORE", destination, key, numkeys))
return row, err
}
示例2: BitPos
func (r *RedisType) BitPos(key string, bit int, borders ...int) (int, error) {
if len(borders) > 0 {
if len(borders) > 1 {
return 0, errors.New("Too many borders")
}
row, err := redis.Int(r.RedisConn.Do("BITPOS", key, bit, borders[0], borders[1]))
return row, err
} else {
row, err := redis.Int(r.RedisConn.Do("BITPOS", key, bit))
return row, err
}
}
示例3: ZRevRank
func (r *RedisType) ZRevRank(key, member string) (int, error) {
row, err := redis.Int(r.RedisConn.Do("ZREVRANK", key, member))
if err == redis.ErrNil {
return 0, nil
}
return row, err
}
示例4: ZCard
func (r *RedisType) ZCard(key string) (int, error) {
row, err := redis.Int(r.RedisConn.Do("ZCARD", key))
if err == redis.ErrNil {
return 0, nil
}
return row, err
}
示例5: ZCount
func (r *RedisType) ZCount(key string, min, max int) (int, error) {
row, err := redis.Int(r.RedisConn.Do("ZCOUNT", key, min, max))
if err == redis.ErrNil {
return 0, nil
}
return row, err
}
示例6: Ttl
func (r *RedisType) Ttl(key string) (int, error) {
row, err := redis.Int(r.RedisConn.Do("TTL", key))
if row < 0 {
row = 0
}
return row, err
}
示例7: SRem
func (r *RedisType) SRem(key string, members ...interface{}) (int, error) {
params := make([]interface{}, 0)
params = append(params, key)
for _, v := range members {
params = append(params, v)
}
row, err := redis.Int(r.RedisConn.Do("SREM", params...))
return row, err
}
示例8: PfAdd
func (r *RedisType) PfAdd(key string, element ...interface{}) (int, error) {
params := make([]interface{}, 0)
params = append(params, key)
for _, v := range element {
params = append(params, v)
}
row, err := redis.Int(r.RedisConn.Do("PFADD", params))
return row, err
}
示例9: ZScore
func (r *RedisType) ZScore(key, member string) (interface{}, error) {
params := make([]interface{}, 0)
params = append(params, key)
params = append(params, member)
row, err := redis.Int(r.RedisConn.Do("ZSCORE", params...))
if err == redis.ErrNil {
return nil, nil
}
return row, err
}
示例10: ZUnionStore
func (r *RedisType) ZUnionStore(destination string, numkeys int, key interface{}, weights ...interface{}) (interface{}, error) {
params := make([]interface{}, 0)
params = append(params, destination)
params = append(params, numkeys)
switch key.(type) {
case string:
params = append(params, key)
case []string:
for _, v := range key.([]string) {
params = append(params, v)
}
}
if len(weights) > 0 {
for _, v := range weights {
params = append(params, v)
}
}
row, err := redis.Int(r.RedisConn.Do("ZUNIONSTORE", params...))
if err == redis.ErrNil {
return nil, nil
}
return row, err
}
示例11: SMove
func (r *RedisType) SMove(source, destination string, member interface{}) (int, error) {
row, err := redis.Int(r.RedisConn.Do("SMOVE", source, destination, member))
return row, err
}
示例12: SInterScore
func (r *RedisType) SInterScore(destination string, key ...interface{}) (int, error) {
row, err := redis.Int(r.RedisConn.Do("SINTERSTORE", destination, key))
return row, err
}
示例13: SCard
func (r *RedisType) SCard(key string) (int, error) {
row, err := redis.Int(r.RedisConn.Do("SCARD", key))
return row, err
}
示例14: ZLexCount
//zlexcount key min max
func (r *RedisType) ZLexCount(key string, min, max int) (int, error) {
row, err := redis.Int(r.RedisConn.Do("ZLEXCOUNT", key, min, max))
return row, err
}
示例15: DecrBy
func (r *RedisType) DecrBy(key string, decrement interface{}) (int, error) {
row, err := redis.Int(r.RedisConn.Do("DECRBY", key, decrement))
return row, err
}