redis rpc服务, 提供redis操作方法
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

30 lines
457 B

package redisrpc
import (
"github.com/golang/protobuf/proto"
)
/**
* 使用用户名查询
*/
func SetExpire(key string, ttl int64, url ...string) (uint64, error) {
conn, _, err := Conn(url...)
if err != nil {
return 0, err
}
defer conn.Close()
req := &SetExpireRequest{proto.String(key), proto.Uint64(ttl), nil}
res := &SetExpireResponse{}
err = conn.SetExpire(req, res)
if err != nil {
return 0, err
}
return res.GetRet(), nil
}