|
@ -22,8 +22,9 @@ It has these top-level messages: |
|
|
DelResponse |
|
|
DelResponse |
|
|
HSetResponse |
|
|
HSetResponse |
|
|
SetExpireResponse |
|
|
SetExpireResponse |
|
|
SAddRequest |
|
|
|
|
|
|
|
|
SSetRequest |
|
|
SMembersRequest |
|
|
SMembersRequest |
|
|
|
|
|
SSetResponse |
|
|
*/ |
|
|
*/ |
|
|
package redisrpc |
|
|
package redisrpc |
|
|
|
|
|
|
|
@ -318,24 +319,24 @@ func (m *SetExpireResponse) GetRet() int64 { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 集合添加值
|
|
|
// 集合添加值
|
|
|
type SAddRequest struct { |
|
|
|
|
|
|
|
|
type SSetRequest struct { |
|
|
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` |
|
|
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` |
|
|
Field *string `protobuf:"bytes,2,opt,name=field" json:"field,omitempty"` |
|
|
Field *string `protobuf:"bytes,2,opt,name=field" json:"field,omitempty"` |
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (m *SAddRequest) Reset() { *m = SAddRequest{} } |
|
|
|
|
|
func (m *SAddRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
|
|
func (*SAddRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
|
func (m *SSetRequest) Reset() { *m = SSetRequest{} } |
|
|
|
|
|
func (m *SSetRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
|
|
func (*SSetRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
|
func (m *SAddRequest) GetKey() string { |
|
|
|
|
|
|
|
|
func (m *SSetRequest) GetKey() string { |
|
|
if m != nil && m.Key != nil { |
|
|
if m != nil && m.Key != nil { |
|
|
return *m.Key |
|
|
return *m.Key |
|
|
} |
|
|
} |
|
|
return "" |
|
|
return "" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (m *SAddRequest) GetField() string { |
|
|
|
|
|
|
|
|
func (m *SSetRequest) GetField() string { |
|
|
if m != nil && m.Field != nil { |
|
|
if m != nil && m.Field != nil { |
|
|
return *m.Field |
|
|
return *m.Field |
|
|
} |
|
|
} |
|
@ -359,6 +360,23 @@ func (m *SMembersRequest) GetKey() string { |
|
|
return "" |
|
|
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 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func init() { |
|
|
func init() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -373,8 +391,9 @@ type RedisService interface { |
|
|
HGetAll(in *GetRequest, out *HGetListResponse) error |
|
|
HGetAll(in *GetRequest, out *HGetListResponse) error |
|
|
HExists(in *HGetRequest, out *DelResponse) error |
|
|
HExists(in *HGetRequest, out *DelResponse) error |
|
|
Exists(in *GetRequest, out *DelResponse) error |
|
|
Exists(in *GetRequest, out *DelResponse) error |
|
|
SAdd(in *SAddRequest, out *HSetResponse) error |
|
|
|
|
|
SIsmember(in *SAddRequest, out *HSetResponse) error |
|
|
|
|
|
|
|
|
SAdd(in *SSetRequest, out *SSetResponse) error |
|
|
|
|
|
SIsmember(in *SSetRequest, out *SSetResponse) error |
|
|
|
|
|
SRem(in *SSetRequest, out *SSetResponse) error |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// AcceptRedisServiceClient accepts connections on the listener and serves requests
|
|
|
// AcceptRedisServiceClient accepts connections on the listener and serves requests
|
|
@ -476,12 +495,15 @@ func (c *RedisServiceClient) HExists(in *HGetRequest, out *DelResponse) error { |
|
|
func (c *RedisServiceClient) Exists(in *GetRequest, out *DelResponse) error { |
|
|
func (c *RedisServiceClient) Exists(in *GetRequest, out *DelResponse) error { |
|
|
return c.Call("RedisService.Exists", in, out) |
|
|
return c.Call("RedisService.Exists", in, out) |
|
|
} |
|
|
} |
|
|
func (c *RedisServiceClient) SAdd(in *SAddRequest, out *HSetResponse) error { |
|
|
|
|
|
|
|
|
func (c *RedisServiceClient) SAdd(in *SSetRequest, out *SSetResponse) error { |
|
|
return c.Call("RedisService.SAdd", in, out) |
|
|
return c.Call("RedisService.SAdd", in, out) |
|
|
} |
|
|
} |
|
|
func (c *RedisServiceClient) SIsmember(in *SAddRequest, out *HSetResponse) error { |
|
|
|
|
|
|
|
|
func (c *RedisServiceClient) SIsmember(in *SSetRequest, out *SSetResponse) error { |
|
|
return c.Call("RedisService.SIsmember", in, out) |
|
|
return c.Call("RedisService.SIsmember", in, out) |
|
|
} |
|
|
} |
|
|
|
|
|
func (c *RedisServiceClient) SRem(in *SSetRequest, out *SSetResponse) error { |
|
|
|
|
|
return c.Call("RedisService.SRem", in, out) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// DialRedisService connects to an RedisService at the specified network address.
|
|
|
// DialRedisService connects to an RedisService at the specified network address.
|
|
|
func DialRedisService(network, addr string) (*RedisServiceClient, *rpc.Client, error) { |
|
|
func DialRedisService(network, addr string) (*RedisServiceClient, *rpc.Client, error) { |
|
|