chore(service): update service

This commit is contained in:
bandl 2021-11-07 20:53:01 +08:00
parent 921078c61d
commit f6eaae71b9
7 changed files with 703 additions and 89 deletions

View File

@ -213,7 +213,7 @@ type SDiffRequest struct {
unknownFields protoimpl.UnknownFields
Key *BaseKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=sKeys,proto3" json:"sKeys,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=s_keys,json=sKeys,proto3" json:"s_keys,omitempty"`
}
func (x *SDiffRequest) Reset() {
@ -315,7 +315,7 @@ type SDiffStoreRequest struct {
unknownFields protoimpl.UnknownFields
Key *BaseKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=sKeys,proto3" json:"sKeys,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=s_keys,json=sKeys,proto3" json:"s_keys,omitempty"`
SaveKey string `protobuf:"bytes,3,opt,name=save_key,json=saveKey,proto3" json:"save_key,omitempty"`
}
@ -416,7 +416,7 @@ type SInterRequest struct {
unknownFields protoimpl.UnknownFields
Key *BaseKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=sKeys,proto3" json:"sKeys,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=s_keys,json=sKeys,proto3" json:"s_keys,omitempty"`
}
func (x *SInterRequest) Reset() {
@ -518,7 +518,7 @@ type SInterStoreRequest struct {
unknownFields protoimpl.UnknownFields
Key *BaseKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=sKeys,proto3" json:"sKeys,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=s_keys,json=sKeys,proto3" json:"s_keys,omitempty"`
SaveKey string `protobuf:"bytes,3,opt,name=save_key,json=saveKey,proto3" json:"save_key,omitempty"`
}
@ -1017,7 +1017,7 @@ type SUnionRequest struct {
unknownFields protoimpl.UnknownFields
Key *BaseKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=sKeys,proto3" json:"sKeys,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=s_keys,json=sKeys,proto3" json:"s_keys,omitempty"`
}
func (x *SUnionRequest) Reset() {
@ -1119,7 +1119,7 @@ type SUnionStoreRequest struct {
unknownFields protoimpl.UnknownFields
Key *BaseKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=sKeys,proto3" json:"sKeys,omitempty"`
SKeys []string `protobuf:"bytes,2,rep,name=s_keys,json=sKeys,proto3" json:"s_keys,omitempty"`
SaveKey string `protobuf:"bytes,3,opt,name=save_key,json=saveKey,proto3" json:"save_key,omitempty"`
}
@ -1347,87 +1347,87 @@ var file_setx_proto_rawDesc = []byte{
0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x27, 0x0a, 0x0d, 0x53, 0x43, 0x61, 0x72, 0x64,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67,
0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
0x22, 0x40, 0x0a, 0x0c, 0x53, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x22, 0x41, 0x0a, 0x0c, 0x53, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e,
0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
0x73, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x4b, 0x65,
0x79, 0x73, 0x22, 0x29, 0x0a, 0x0d, 0x53, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x6c, 0x75, 0x74, 0x73, 0x18, 0x02,
0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x73, 0x6c, 0x75, 0x74, 0x73, 0x22, 0x60, 0x0a,
0x11, 0x53, 0x44, 0x69, 0x66, 0x66, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73,
0x4b, 0x65, 0x79, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x61, 0x76, 0x65, 0x5f, 0x6b, 0x65, 0x79,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x61, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x22,
0x14, 0x0a, 0x12, 0x53, 0x44, 0x69, 0x66, 0x66, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x0a, 0x0d, 0x53, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x09, 0x52, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x2a, 0x0a, 0x0e, 0x53, 0x49, 0x6e, 0x74,
0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65,
0x73, 0x6c, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x73,
0x6c, 0x75, 0x74, 0x73, 0x22, 0x61, 0x0a, 0x12, 0x53, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x53, 0x74,
0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65,
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65,
0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x19, 0x0a, 0x08,
0x73, 0x61, 0x76, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x73, 0x61, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x49, 0x6e, 0x74, 0x65,
0x72, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x46,
0x0a, 0x10, 0x53, 0x49, 0x73, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16,
0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x29, 0x0a, 0x11, 0x53, 0x49, 0x73, 0x4d, 0x65, 0x6d,
0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,
0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x78, 0x69, 0x73,
0x74, 0x22, 0x5f, 0x0a, 0x0c, 0x53, 0x4d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08,
0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x19, 0x0a,
0x08, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x6d, 0x6f, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62,
0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65,
0x72, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x4d, 0x6f, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x3f, 0x0a, 0x0b, 0x53, 0x50, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63,
0x6f, 0x75, 0x6e, 0x74, 0x22, 0x28, 0x0a, 0x0c, 0x53, 0x50, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x3f,
0x0a, 0x0b, 0x53, 0x52, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73,
0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22,
0x0e, 0x0a, 0x0c, 0x53, 0x52, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x41, 0x0a, 0x0d, 0x53, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e,
0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
0x73, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x4b, 0x65,
0x79, 0x73, 0x22, 0x2a, 0x0a, 0x0e, 0x53, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x61,
0x0a, 0x12, 0x53, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52,
0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06,
0x73, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x4b,
0x65, 0x79, 0x73, 0x22, 0x29, 0x0a, 0x0d, 0x53, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x6c, 0x75, 0x74, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x73, 0x6c, 0x75, 0x74, 0x73, 0x22, 0x61,
0x0a, 0x11, 0x53, 0x44, 0x69, 0x66, 0x66, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x15, 0x0a, 0x06, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52,
0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x61, 0x76, 0x65, 0x5f, 0x6b,
0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x61, 0x76, 0x65, 0x4b, 0x65,
0x79, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x70, 0x0a, 0x0c, 0x53, 0x53, 0x63, 0x61,
0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x79, 0x22, 0x14, 0x0a, 0x12, 0x53, 0x44, 0x69, 0x66, 0x66, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x42, 0x0a, 0x0d, 0x53, 0x49, 0x6e, 0x74, 0x65,
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52,
0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06,
0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65,
0x67, 0x65, 0x78, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20,
0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x29, 0x0a, 0x0d, 0x53, 0x53,
0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x73, 0x42, 0x0b, 0x5a, 0x09, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x03, 0x6b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02,
0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x2a, 0x0a, 0x0e, 0x53,
0x49, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a,
0x07, 0x72, 0x65, 0x73, 0x6c, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07,
0x72, 0x65, 0x73, 0x6c, 0x75, 0x74, 0x73, 0x22, 0x62, 0x0a, 0x12, 0x53, 0x49, 0x6e, 0x74, 0x65,
0x72, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73,
0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x5f, 0x6b,
0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73,
0x12, 0x19, 0x0a, 0x08, 0x73, 0x61, 0x76, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x73, 0x61, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x15, 0x0a, 0x13, 0x53,
0x49, 0x6e, 0x74, 0x65, 0x72, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x46, 0x0a, 0x10, 0x53, 0x49, 0x73, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x29, 0x0a, 0x11, 0x53, 0x49,
0x73, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x65, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
0x65, 0x78, 0x69, 0x73, 0x74, 0x22, 0x5f, 0x0a, 0x0c, 0x53, 0x4d, 0x6f, 0x76, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07,
0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d,
0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x4d, 0x6f, 0x76, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x0a, 0x0b, 0x53, 0x50, 0x6f, 0x70, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x28, 0x0a, 0x0c, 0x53, 0x50, 0x6f, 0x70,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62,
0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65,
0x72, 0x73, 0x22, 0x3f, 0x0a, 0x0b, 0x53, 0x52, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08,
0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a,
0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x53, 0x52, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x42, 0x0a, 0x0d, 0x53, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x15, 0x0a, 0x06, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09,
0x52, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x2a, 0x0a, 0x0e, 0x53, 0x55, 0x6e, 0x69, 0x6f,
0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x73, 0x22, 0x62, 0x0a, 0x12, 0x53, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f,
0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x6b, 0x65, 0x79,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4b, 0x65, 0x79,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18,
0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x19, 0x0a, 0x08,
0x73, 0x61, 0x76, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x73, 0x61, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x55, 0x6e, 0x69, 0x6f,
0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x70,
0x0a, 0x0c, 0x53, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x61,
0x73, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75,
0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x75, 0x72, 0x73,
0x6f, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x22, 0x29, 0x0a, 0x0d, 0x53, 0x53, 0x63, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03,
0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x42, 0x0b, 0x5a, 0x09, 0x70,
0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -20,7 +20,7 @@ message SCardResponse {
message SDiffRequest {
BaseKey key = 1;
repeated string sKeys = 2;
repeated string s_keys = 2;
}
message SDiffResponse {
@ -29,7 +29,7 @@ message SDiffResponse {
message SDiffStoreRequest {
BaseKey key = 1;
repeated string sKeys = 2;
repeated string s_keys = 2;
string save_key = 3;
}
@ -38,7 +38,7 @@ message SDiffStoreResponse {
message SInterRequest {
BaseKey key = 1;
repeated string sKeys = 2;
repeated string s_keys = 2;
}
message SInterResponse {
@ -47,7 +47,7 @@ message SInterResponse {
message SInterStoreRequest {
BaseKey key = 1;
repeated string sKeys = 2;
repeated string s_keys = 2;
string save_key = 3;
}
@ -91,7 +91,7 @@ message SRemResponse {
message SUnionRequest {
BaseKey key = 1;
repeated string sKeys = 2;
repeated string s_keys = 2;
}
message SUnionResponse {
@ -100,7 +100,7 @@ message SUnionResponse {
message SUnionStoreRequest {
BaseKey key = 1;
repeated string sKeys = 2;
repeated string s_keys = 2;
string save_key = 3;
}

View File

@ -116,6 +116,45 @@ func (d *Dao) ExecMessage(message protobuf.Message) error {
case *proto.StrLenRequest:
_, err := d.StrLen(req.Key)
return err
case *proto.SAddRequest:
_, err := d.SAdd(req.Key, req.Member)
return err
case *proto.SCardRequest:
_, err := d.SCard(req.Key)
return err
case *proto.SDiffRequest:
_, err := d.SDiff(req.Key, req.SKeys)
return err
case *proto.SDiffStoreRequest:
_, err := d.SDiffStore(req.Key, req.SKeys, req.SaveKey)
return err
case *proto.SInterRequest:
_, err := d.SInter(req.Key, req.SKeys)
return err
case *proto.SInterStoreRequest:
_, err := d.SInterStore(req.Key, req.SKeys, req.SaveKey)
return err
case *proto.SIsMemberRequest:
_, err := d.SIsMember(req.Key, req.Member)
return err
case *proto.SMoveRequest:
_, err := d.SMove(req.Key, req.MoveKey, req.Members)
return err
case *proto.SPopRequest:
_, err := d.SPop(req.Key, req.Count)
return err
case *proto.SRemRequest:
_, err := d.SRem(req.Key, req.Count)
return err
case *proto.SUnionRequest:
_, err := d.SUnion(req.Key, req.SKeys)
return err
case *proto.SUnionStoreRequest:
_, err := d.SUnionStore(req.Key, req.SKeys, req.SaveKey)
return err
case *proto.SScanRequest:
_, err := d.SScan(req.Key, req.Sursor, req.Regexp, req.Count)
return err
default:
return errorx.New("The type that is not registered exec err")
}

View File

@ -40,5 +40,18 @@ type Interface interface {
GetRange(*proto.BaseKey, int32, int32) (*proto.GetRangeResponse, error)
GetSet(*proto.BaseKey, string) (*proto.GetSetResponse, error)
StrLen(*proto.BaseKey) (*proto.StrLenResponse, error)
SAdd(*proto.BaseKey, []string) (*proto.SAddResponse, error)
SCard(*proto.BaseKey) (*proto.SCardResponse, error)
SDiff(*proto.BaseKey, []string) (*proto.SDiffResponse, error)
SDiffStore(*proto.BaseKey, []string, string) (*proto.SDiffStoreResponse, error)
SInter(*proto.BaseKey, []string) (*proto.SInterResponse, error)
SInterStore(*proto.BaseKey, []string, string) (*proto.SInterStoreResponse, error)
SIsMember(*proto.BaseKey, string) (*proto.SIsMemberResponse, error)
SMove(*proto.BaseKey, string, []string) (*proto.SMoveResponse, error)
SPop(*proto.BaseKey, int32) (*proto.SPopResponse, error)
SRem(*proto.BaseKey, int32) (*proto.SRemResponse, error)
SUnion(*proto.BaseKey, []string) (*proto.SUnionResponse, error)
SUnionStore(*proto.BaseKey, []string, string) (*proto.SUnionStoreResponse, error)
SScan(*proto.BaseKey, int32, string, int32) (*proto.SScanResponse, error)
ExecMessage(message protobuf.Message) error
}

55
storage/dao/setx.go Normal file
View File

@ -0,0 +1,55 @@
package dao
import "gitee.com/wheat-os/wheatCache/pkg/proto"
func (d *Dao) SAdd(_ *proto.BaseKey, _ []string) (*proto.SAddResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SCard(_ *proto.BaseKey) (*proto.SCardResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SDiff(_ *proto.BaseKey, _ []string) (*proto.SDiffResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SDiffStore(_ *proto.BaseKey, _ []string, _ string) (*proto.SDiffStoreResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SInter(_ *proto.BaseKey, _ []string) (*proto.SInterResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SInterStore(_ *proto.BaseKey, _ []string, _ string) (*proto.SInterStoreResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SIsMember(_ *proto.BaseKey, _ string) (*proto.SIsMemberResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SMove(_ *proto.BaseKey, _ string, _ []string) (*proto.SMoveResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SPop(_ *proto.BaseKey, _ int32) (*proto.SPopResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SRem(_ *proto.BaseKey, _ int32) (*proto.SRemResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SUnion(_ *proto.BaseKey, _ []string) (*proto.SUnionResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SUnionStore(_ *proto.BaseKey, _ []string, _ string) (*proto.SUnionStoreResponse, error) {
panic("not implemented") // TODO: Implement
}
func (d *Dao) SScan(_ *proto.BaseKey, _ int32, _ string, _ int32) (*proto.SScanResponse, error) {
panic("not implemented") // TODO: Implement
}

View File

@ -110,6 +110,32 @@ func decode(method string, buf []byte) (protobuf.Message, error) {
return decodeGetSet(buf)
case "StrLen":
return decodeStrLen(buf)
case "SAdd":
return decodeSAdd(buf)
case "SCard":
return decodeSCard(buf)
case "SDiff":
return decodeSDiff(buf)
case "SDiffStore":
return decodeSDiffStore(buf)
case "SInter":
return decodeSInter(buf)
case "SInterStore":
return decodeSInterStore(buf)
case "SIsMember":
return decodeSIsMember(buf)
case "SMove":
return decodeSMove(buf)
case "SPop":
return decodeSPop(buf)
case "SRem":
return decodeSRem(buf)
case "SUnion":
return decodeSUnion(buf)
case "SUnionStore":
return decodeSUnionStore(buf)
case "SScan":
return decodeSScan(buf)
}
@ -394,3 +420,120 @@ func decodeStrLen(buf []byte) (*proto.StrLenRequest, error) {
}
return req, nil
}
func decodeSAdd(buf []byte) (*proto.SAddRequest, error) {
req := &proto.SAddRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSCard(buf []byte) (*proto.SCardRequest, error) {
req := &proto.SCardRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSDiff(buf []byte) (*proto.SDiffRequest, error) {
req := &proto.SDiffRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSDiffStore(buf []byte) (*proto.SDiffStoreRequest, error) {
req := &proto.SDiffStoreRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSInter(buf []byte) (*proto.SInterRequest, error) {
req := &proto.SInterRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSInterStore(buf []byte) (*proto.SInterStoreRequest, error) {
req := &proto.SInterStoreRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSIsMember(buf []byte) (*proto.SIsMemberRequest, error) {
req := &proto.SIsMemberRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSMove(buf []byte) (*proto.SMoveRequest, error) {
req := &proto.SMoveRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSPop(buf []byte) (*proto.SPopRequest, error) {
req := &proto.SPopRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSRem(buf []byte) (*proto.SRemRequest, error) {
req := &proto.SRemRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSUnion(buf []byte) (*proto.SUnionRequest, error) {
req := &proto.SUnionRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSUnionStore(buf []byte) (*proto.SUnionStoreRequest, error) {
req := &proto.SUnionStoreRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}
func decodeSScan(buf []byte) (*proto.SScanRequest, error) {
req := &proto.SScanRequest{}
err := protobuf.Unmarshal(buf, req)
if err != nil {
return nil, err
}
return req, nil
}

View File

@ -877,3 +877,367 @@ func (s *singleService) StrLen(
return resp.(*proto.StrLenResponse), nil
}
func (s *singleService) SAdd(
ctx context.Context,
req *proto.SAddRequest,
) (*proto.SAddResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SAdd(req.Key, req.Member)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SAdd", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SAddResponse), nil
}
func (s *singleService) SCard(
ctx context.Context,
req *proto.SCardRequest,
) (*proto.SCardResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SCard(req.Key)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SCard", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SCardResponse), nil
}
func (s *singleService) SDiff(
ctx context.Context,
req *proto.SDiffRequest,
) (*proto.SDiffResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SDiff(req.Key, req.SKeys)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SDiff", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SDiffResponse), nil
}
func (s *singleService) SDiffStore(
ctx context.Context,
req *proto.SDiffStoreRequest,
) (*proto.SDiffStoreResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SDiffStore(req.Key, req.SKeys, req.SaveKey)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SDiffStore", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SDiffStoreResponse), nil
}
func (s *singleService) SInter(
ctx context.Context,
req *proto.SInterRequest,
) (*proto.SInterResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SInter(req.Key, req.SKeys)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SInter", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SInterResponse), nil
}
func (s *singleService) SInterStore(
ctx context.Context,
req *proto.SInterStoreRequest,
) (*proto.SInterStoreResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SInterStore(req.Key, req.SKeys, req.SaveKey)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SInterStore", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SInterStoreResponse), nil
}
func (s *singleService) SIsMember(
ctx context.Context,
req *proto.SIsMemberRequest,
) (*proto.SIsMemberResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SIsMember(req.Key, req.Member)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SIsMember", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SIsMemberResponse), nil
}
func (s *singleService) SMove(
ctx context.Context,
req *proto.SMoveRequest,
) (*proto.SMoveResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SMove(req.Key, req.MoveKey, req.Members)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SMove", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SMoveResponse), nil
}
func (s *singleService) SPop(
ctx context.Context,
req *proto.SPopRequest,
) (*proto.SPopResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SPop(req.Key, req.Count)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SPop", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SPopResponse), nil
}
func (s *singleService) SRem(
ctx context.Context,
req *proto.SRemRequest,
) (*proto.SRemResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SRem(req.Key, req.Count)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SRem", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SRemResponse), nil
}
func (s *singleService) SUnion(
ctx context.Context,
req *proto.SUnionRequest,
) (*proto.SUnionResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SUnion(req.Key, req.SKeys)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SUnion", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SUnionResponse), nil
}
func (s *singleService) SUnionStore(
ctx context.Context,
req *proto.SUnionStoreRequest,
) (*proto.SUnionStoreResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SUnionStore(req.Key, req.SKeys, req.SaveKey)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SUnionStore", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SUnionStoreResponse), nil
}
func (s *singleService) SScan(
ctx context.Context,
req *proto.SScanRequest,
) (*proto.SScanResponse, error) {
work := event.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SScan(req.Key, req.Sursor, req.Regexp, req.Count)
if err != nil {
return nil, err
}
if s.aof != nil {
s.aof.SendRequest("SScan", req)
}
return resp, nil
})
lruEvent := s.lruProduce.NewEvent(lru.OptionEventName)
lruEvent.InitWaitEvent()
lruEvent.SetValue(lru.WorkFuncEventKey, work)
s.lruProduce.Call(ctx, lruEvent)
resp, err := lruEvent.StartWaitEvent(s.timeOut)
s.lruProduce.Recovery(lruEvent)
if err != nil {
return nil, err
}
return resp.(*proto.SScanResponse), nil
}