本文整理汇总了Golang中github.com/redigo/redis.Int函数的典型用法代码示例。如果您正苦于以下问题:Golang Int函数的具体用法?Golang Int怎么用?Golang Int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Int函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:9,代码来源:zset.go
示例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
}
}
开发者ID:kaizer666,项目名称:Redis,代码行数:12,代码来源:strings.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:7,代码来源:zset.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:7,代码来源:zset.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:7,代码来源:zset.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:7,代码来源:Redis.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:9,代码来源:set.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:9,代码来源:hyperloglog.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:10,代码来源:zset.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:23,代码来源:zset.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:4,代码来源:set.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:4,代码来源:set.go
示例13: SCard
func (r *RedisType) SCard(key string) (int, error) {
row, err := redis.Int(r.RedisConn.Do("SCARD", key))
return row, err
}
开发者ID:kaizer666,项目名称:Redis,代码行数:4,代码来源:set.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:5,代码来源:zset.go
示例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
}
开发者ID:kaizer666,项目名称:Redis,代码行数:4,代码来源:strings.go
示例16: Publish
func (r *RedisType) Publish(channel string, message interface{}) (int, error) {
row, err := redis.Int(r.RedisConn.Do("PUBLISH", channel, message))
return row, err
}
开发者ID:kaizer666,项目名称:Redis,代码行数:4,代码来源:channels.go
示例17: Expire
func (r *RedisType) Expire(key string, seconds uint32) (int, error) {
row, err := redis.Int(r.RedisConn.Do("EXPIRE", key, seconds))
return row, err
}
开发者ID:kaizer666,项目名称:Redis,代码行数:4,代码来源:Redis.go
示例18: Append
func (r *RedisType) Append(key string, value interface{}) (int, error) {
row, err := redis.Int(r.RedisConn.Do("APPEND", key, value))
return row, err
}
开发者ID:kaizer666,项目名称:Redis,代码行数:4,代码来源:strings.go
示例19: StrLen
func (r *RedisType) StrLen(key string) (int, error) {
row, err := redis.Int(r.RedisConn.Do("STRLEN", key))
return row, err
}
开发者ID:kaizer666,项目名称:Redis,代码行数:4,代码来源:strings.go
示例20: ExpireAt
func (r *RedisType) ExpireAt(key string, timestamp uint32) (int, error) {
row, err := redis.Int(r.RedisConn.Do("EXPIREAT", key, timestamp))
return row, err
}
开发者ID:kaizer666,项目名称:Redis,代码行数:4,代码来源:Redis.go
注:本文中的github.com/redigo/redis.Int函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论