|
|
@ -29,6 +29,8 @@ It has these top-level messages: |
|
|
|
LSetResponse |
|
|
|
LRangeRequest |
|
|
|
LLenRequest |
|
|
|
AddRequest |
|
|
|
AddResponse |
|
|
|
*/ |
|
|
|
package redisrpc |
|
|
|
|
|
|
@ -473,6 +475,47 @@ func (m *LLenRequest) GetKey() string { |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
// 数值增加
|
|
|
|
type AddRequest struct { |
|
|
|
Key *string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` |
|
|
|
Value *int64 `protobuf:"varint,2,opt,name=value" json:"value,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *AddRequest) Reset() { *m = AddRequest{} } |
|
|
|
func (m *AddRequest) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*AddRequest) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *AddRequest) GetKey() string { |
|
|
|
if m != nil && m.Key != nil { |
|
|
|
return *m.Key |
|
|
|
} |
|
|
|
return "" |
|
|
|
} |
|
|
|
|
|
|
|
func (m *AddRequest) GetValue() int64 { |
|
|
|
if m != nil && m.Value != nil { |
|
|
|
return *m.Value |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
type AddResponse struct { |
|
|
|
Ret *int64 `protobuf:"varint,1,opt,name=ret" json:"ret,omitempty"` |
|
|
|
XXX_unrecognized []byte `json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func (m *AddResponse) Reset() { *m = AddResponse{} } |
|
|
|
func (m *AddResponse) String() string { return proto.CompactTextString(m) } |
|
|
|
func (*AddResponse) ProtoMessage() {} |
|
|
|
|
|
|
|
func (m *AddResponse) GetRet() int64 { |
|
|
|
if m != nil && m.Ret != nil { |
|
|
|
return *m.Ret |
|
|
|
} |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
func init() { |
|
|
|
} |
|
|
|
|
|
|
@ -498,6 +541,8 @@ type RedisService interface { |
|
|
|
LRange(in *LRangeRequest, out *HGetListResponse) error |
|
|
|
LLen(in *LLenRequest, out *LSetResponse) error |
|
|
|
ReduceStock(in *SetRequest, out *SetResponse) error |
|
|
|
Incrby(in *AddRequest, out *AddResponse) error |
|
|
|
Decrby(in *AddRequest, out *AddResponse) error |
|
|
|
} |
|
|
|
|
|
|
|
// AcceptRedisServiceClient accepts connections on the listener and serves requests
|
|
|
@ -632,6 +677,12 @@ func (c *RedisServiceClient) LLen(in *LLenRequest, out *LSetResponse) error { |
|
|
|
func (c *RedisServiceClient) ReduceStock(in *SetRequest, out *SetResponse) error { |
|
|
|
return c.Call("RedisService.ReduceStock", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) Incrby(in *AddRequest, out *AddResponse) error { |
|
|
|
return c.Call("RedisService.Incrby", in, out) |
|
|
|
} |
|
|
|
func (c *RedisServiceClient) Decrby(in *AddRequest, out *AddResponse) error { |
|
|
|
return c.Call("RedisService.Decrby", in, out) |
|
|
|
} |
|
|
|
|
|
|
|
// DialRedisService connects to an RedisService at the specified network address.
|
|
|
|
func DialRedisService(network, addr string) (*RedisServiceClient, *rpc.Client, error) { |
|
|
|