|
|
@ -31,6 +31,10 @@ It has these top-level messages: |
|
|
|
LLenRequest |
|
|
|
AddRequest |
|
|
|
AddResponse |
|
|
|
ZSetRequest |
|
|
|
ZSetResponse |
|
|
|
ZRangeRequest |
|
|
|
ZScanRequest |
|
|
|
*/ |
|
|
|
package redisrpc |
|
|
|
|
|
|
@ -516,6 +520,121 @@ func (m *AddResponse) GetRet() int64 { |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
// 有序集合添加值
|
|
|
|
type ZSetRequest struct { |
|
|
|
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` |
|
|
|
Score *string `protobuf:"bytes,2,opt,name=score" json:"score,omitempty"` |
|
|
|
Member *string `protobuf:"bytes,3,opt,name=member" json:"member,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ZSetRequest) Reset() { *m = ZSetRequest{} } |
|
|
|
func (m *ZSetRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*ZSetRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *ZSetRequest) GetKey() string { |
|
|
|
if m != nil && m.Key != nil { |
|
|
|
return *m.Key |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ZSetRequest) GetScore() string { |
|
|
|
if m != nil && m.Score != nil { |
|
|
|
return *m.Score |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ZSetRequest) GetMember() string { |
|
|
|
if m != nil && m.Member != nil { |
|
|
|
return *m.Member |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
// 设置响应结构
|
|
|
|
type ZSetResponse struct { |
|
|
|
Ret *int64 `protobuf:"varint,1,opt,name=ret" json:"ret,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ZSetResponse) Reset() { *m = ZSetResponse{} } |
|
|
|
func (m *ZSetResponse) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*ZSetResponse) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *ZSetResponse) GetRet() int64 { |
|
|
|
if m != nil && m.Ret != nil { |
|
|
|
return *m.Ret |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
// 有序集合取值
|
|
|
|
type ZRangeRequest struct { |
|
|
|
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` |
|
|
|
Start *int64 `protobuf:"varint,2,opt,name=start" json:"start,omitempty"` |
|
|
|
Stop *int64 `protobuf:"varint,3,opt,name=stop" json:"stop,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ZRangeRequest) Reset() { *m = ZRangeRequest{} } |
|
|
|
func (m *ZRangeRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*ZRangeRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *ZRangeRequest) GetKey() string { |
|
|
|
if m != nil && m.Key != nil { |
|
|
|
return *m.Key |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ZRangeRequest) GetStart() int64 { |
|
|
|
if m != nil && m.Start != nil { |
|
|
|
return *m.Start |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ZRangeRequest) GetStop() int64 { |
|
|
|
if m != nil && m.Stop != nil { |
|
|
|
return *m.Stop |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
type ZScanRequest struct { |
|
|
|
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` |
|
|
|
Field *string `protobuf:"bytes,2,opt,name=field" json:"field,omitempty"` |
|
|
|
Len *int64 `protobuf:"varint,3,opt,name=len" json:"len,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ZScanRequest) Reset() { *m = ZScanRequest{} } |
|
|
|
func (m *ZScanRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*ZScanRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *ZScanRequest) GetKey() string { |
|
|
|
if m != nil && m.Key != nil { |
|
|
|
return *m.Key |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ZScanRequest) GetField() string { |
|
|
|
if m != nil && m.Field != nil { |
|
|
|
return *m.Field |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
func (m *ZScanRequest) GetLen() int64 { |
|
|
|
if m != nil && m.Len != nil { |
|
|
|
return *m.Len |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
func init() { |
|
|
|
} |
|
|
|
|
|
|
@ -544,6 +663,10 @@ type RedisService interface { |
|
|
|
ReduceStock(in *SetRequest, out *SetResponse) error |
|
|
|
Incrby(in *AddRequest, out *AddResponse) error |
|
|
|
Decrby(in *AddRequest, out *AddResponse) error |
|
|
|
ZAdd(in *ZSetRequest, out *ZSetResponse) error |
|
|
|
ZIncrBy(in *ZSetRequest, out *ZSetResponse) error |
|
|
|
ZRange(in *ZRangeRequest, out *HGetListResponse) error |
|
|
|
ZScan(in *ZScanRequest, out *HGetListResponse) error |
|
|
|
} |
|
|
|
|
|
|
|
// AcceptRedisServiceClient accepts connections on the listener and serves requests
|
|
|
@ -687,6 +810,18 @@ func (c *RedisServiceClient) Incrby(in *AddRequest, out *AddResponse) error { |
|
|
|
func (c *RedisServiceClient) Decrby(in *AddRequest, out *AddResponse) error { |
|
|
|
return c.Call("RedisService.Decrby", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) ZAdd(in *ZSetRequest, out *ZSetResponse) error { |
|
|
|
return c.Call("RedisService.ZAdd", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) ZIncrBy(in *ZSetRequest, out *ZSetResponse) error { |
|
|
|
return c.Call("RedisService.ZIncrBy", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) ZRange(in *ZRangeRequest, out *HGetListResponse) error { |
|
|
|
return c.Call("RedisService.ZRange", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) ZScan(in *ZScanRequest, out *HGetListResponse) error { |
|
|
|
return c.Call("RedisService.ZScan", in, out) |
|
|
|
} |
|
|
|
|
|
|
|
// DialRedisService connects to an RedisService at the specified network address.
|
|
|
|
func DialRedisService(network, addr string) (*RedisServiceClient, *rpc.Client, error) { |
|
|
|