|
|
@ -22,6 +22,13 @@ It has these top-level messages: |
|
|
|
DelResponse |
|
|
|
HSetResponse |
|
|
|
SetExpireResponse |
|
|
|
SSetRequest |
|
|
|
SMembersRequest |
|
|
|
SSetResponse |
|
|
|
LSetRequest |
|
|
|
LSetResponse |
|
|
|
LRangeRequest |
|
|
|
LLenRequest |
|
|
|
*/ |
|
|
|
package redisrpc |
|
|
|
|
|
|
@ -315,6 +322,157 @@ func (m *SetExpireResponse) GetRet() int64 { |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
// 集合添加值
|
|
|
|
type SSetRequest struct { |
|
|
|
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` |
|
|
|
Field *string `protobuf:"bytes,2,opt,name=field" json:"field,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *SSetRequest) Reset() { *m = SSetRequest{} } |
|
|
|
func (m *SSetRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*SSetRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *SSetRequest) GetKey() string { |
|
|
|
if m != nil && m.Key != nil { |
|
|
|
return *m.Key |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
func (m *SSetRequest) GetField() string { |
|
|
|
if m != nil && m.Field != nil { |
|
|
|
return *m.Field |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
// 集合添加值
|
|
|
|
type SMembersRequest struct { |
|
|
|
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *SMembersRequest) Reset() { *m = SMembersRequest{} } |
|
|
|
func (m *SMembersRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*SMembersRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *SMembersRequest) GetKey() string { |
|
|
|
if m != nil && m.Key != nil { |
|
|
|
return *m.Key |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
// 设置响应结构
|
|
|
|
type SSetResponse struct { |
|
|
|
Ret *int64 `protobuf:"varint,1,opt,name=ret" json:"ret,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *SSetResponse) Reset() { *m = SSetResponse{} } |
|
|
|
func (m *SSetResponse) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*SSetResponse) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *SSetResponse) GetRet() int64 { |
|
|
|
if m != nil && m.Ret != nil { |
|
|
|
return *m.Ret |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
// 列表添加值
|
|
|
|
type LSetRequest struct { |
|
|
|
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` |
|
|
|
Field *string `protobuf:"bytes,2,opt,name=field" json:"field,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *LSetRequest) Reset() { *m = LSetRequest{} } |
|
|
|
func (m *LSetRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*LSetRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *LSetRequest) GetKey() string { |
|
|
|
if m != nil && m.Key != nil { |
|
|
|
return *m.Key |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
func (m *LSetRequest) GetField() string { |
|
|
|
if m != nil && m.Field != nil { |
|
|
|
return *m.Field |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
// 设置key响应结构
|
|
|
|
type LSetResponse struct { |
|
|
|
Ret *int64 `protobuf:"varint,1,opt,name=ret" json:"ret,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *LSetResponse) Reset() { *m = LSetResponse{} } |
|
|
|
func (m *LSetResponse) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*LSetResponse) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *LSetResponse) GetRet() int64 { |
|
|
|
if m != nil && m.Ret != nil { |
|
|
|
return *m.Ret |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
// 列表取值
|
|
|
|
type LRangeRequest 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 *LRangeRequest) Reset() { *m = LRangeRequest{} } |
|
|
|
func (m *LRangeRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*LRangeRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *LRangeRequest) GetKey() string { |
|
|
|
if m != nil && m.Key != nil { |
|
|
|
return *m.Key |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
func (m *LRangeRequest) GetStart() int64 { |
|
|
|
if m != nil && m.Start != nil { |
|
|
|
return *m.Start |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
func (m *LRangeRequest) GetStop() int64 { |
|
|
|
if m != nil && m.Stop != nil { |
|
|
|
return *m.Stop |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
// 列表长度
|
|
|
|
type LLenRequest struct { |
|
|
|
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *LLenRequest) Reset() { *m = LLenRequest{} } |
|
|
|
func (m *LLenRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*LLenRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *LLenRequest) GetKey() string { |
|
|
|
if m != nil && m.Key != nil { |
|
|
|
return *m.Key |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
func init() { |
|
|
|
} |
|
|
|
|
|
|
@ -327,8 +485,17 @@ type RedisService interface { |
|
|
|
HDel(in *HDelRequest, out *DelResponse) error |
|
|
|
SetExpire(in *SetExpireRequest, out *SetExpireResponse) error |
|
|
|
HGetAll(in *GetRequest, out *HGetListResponse) error |
|
|
|
HGetList(in *GetRequest, out *HGetListResponse) error |
|
|
|
HExists(in *HGetRequest, out *DelResponse) error |
|
|
|
Exists(in *GetRequest, out *DelResponse) error |
|
|
|
SAdd(in *SSetRequest, out *SSetResponse) error |
|
|
|
SIsmember(in *SSetRequest, out *SSetResponse) error |
|
|
|
SRem(in *SSetRequest, out *SSetResponse) error |
|
|
|
LLpush(in *LSetRequest, out *LSetResponse) error |
|
|
|
LRpush(in *LSetRequest, out *LSetResponse) error |
|
|
|
LRange(in *LRangeRequest, out *HGetListResponse) error |
|
|
|
LLen(in *LLenRequest, out *LSetResponse) error |
|
|
|
ReduceStock(in *SetRequest, out *SetResponse) error |
|
|
|
} |
|
|
|
|
|
|
|
// AcceptRedisServiceClient accepts connections on the listener and serves requests
|
|
|
@ -424,12 +591,39 @@ func (c *RedisServiceClient) SetExpire(in *SetExpireRequest, out *SetExpireRespo |
|
|
|
func (c *RedisServiceClient) HGetAll(in *GetRequest, out *HGetListResponse) error { |
|
|
|
return c.Call("RedisService.HGetAll", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) HGetList(in *GetRequest, out *HGetListResponse) error { |
|
|
|
return c.Call("RedisService.HGetList", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) HExists(in *HGetRequest, out *DelResponse) error { |
|
|
|
return c.Call("RedisService.HExists", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) Exists(in *GetRequest, out *DelResponse) error { |
|
|
|
return c.Call("RedisService.Exists", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) SAdd(in *SSetRequest, out *SSetResponse) error { |
|
|
|
return c.Call("RedisService.SAdd", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) SIsmember(in *SSetRequest, out *SSetResponse) error { |
|
|
|
return c.Call("RedisService.SIsmember", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) SRem(in *SSetRequest, out *SSetResponse) error { |
|
|
|
return c.Call("RedisService.SRem", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) LLpush(in *LSetRequest, out *LSetResponse) error { |
|
|
|
return c.Call("RedisService.LLpush", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) LRpush(in *LSetRequest, out *LSetResponse) error { |
|
|
|
return c.Call("RedisService.LRpush", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) LRange(in *LRangeRequest, out *HGetListResponse) error { |
|
|
|
return c.Call("RedisService.LRange", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) LLen(in *LLenRequest, out *LSetResponse) error { |
|
|
|
return c.Call("RedisService.LLen", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) ReduceStock(in *SetRequest, out *SetResponse) error { |
|
|
|
return c.Call("RedisService.ReduceStock", in, out) |
|
|
|
} |
|
|
|
|
|
|
|
// DialRedisService connects to an RedisService at the specified network address.
|
|
|
|
func DialRedisService(network, addr string) (*RedisServiceClient, *rpc.Client, error) { |
|
|
|