|
@ -18,7 +18,20 @@ func Rpush(key string, field interface{}) (int64, error) { |
|
|
|
|
|
|
|
|
return redisdb.Int64(reply, nil) |
|
|
return redisdb.Int64(reply, nil) |
|
|
} |
|
|
} |
|
|
|
|
|
//移除列表的最后一个元素,返回值为移除的元素。
|
|
|
|
|
|
func Rpop(key string) ([]byte, error) { |
|
|
|
|
|
c := GetConn() |
|
|
|
|
|
|
|
|
|
|
|
ret, err := c.Do("RPOP", key) |
|
|
|
|
|
CloseConn(c) |
|
|
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
reply, err := redisdb.Bytes(ret, err) |
|
|
|
|
|
|
|
|
|
|
|
return reply, err |
|
|
|
|
|
} |
|
|
//list 头部增加值
|
|
|
//list 头部增加值
|
|
|
|
|
|
|
|
|
func Lpush(key string, field interface{}) (int64, error) { |
|
|
func Lpush(key string, field interface{}) (int64, error) { |
|
|