chore(proto): update proto

This commit is contained in:
bandl 2021-11-14 21:16:36 +08:00
parent 5105a62bca
commit 366793d955
9 changed files with 260 additions and 108 deletions

View File

@ -84,6 +84,44 @@ func (x *BaseKey) GetExpire() *timestamppb.Timestamp {
return nil
}
type External struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *External) Reset() {
*x = External{}
if protoimpl.UnsafeEnabled {
mi := &file_base_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *External) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*External) ProtoMessage() {}
func (x *External) ProtoReflect() protoreflect.Message {
mi := &file_base_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use External.ProtoReflect.Descriptor instead.
func (*External) Descriptor() ([]byte, []int) {
return file_base_proto_rawDescGZIP(), []int{1}
}
var File_base_proto protoreflect.FileDescriptor
var file_base_proto_rawDesc = []byte{
@ -96,8 +134,9 @@ var file_base_proto_rawDesc = []byte{
0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65,
0x42, 0x0b, 0x5a, 0x09, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x22, 0x0a, 0x0a, 0x08, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x42, 0x0b, 0x5a, 0x09,
0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
@ -112,13 +151,14 @@ func file_base_proto_rawDescGZIP() []byte {
return file_base_proto_rawDescData
}
var file_base_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_base_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_base_proto_goTypes = []interface{}{
(*BaseKey)(nil), // 0: BaseKey
(*timestamppb.Timestamp)(nil), // 1: google.protobuf.Timestamp
(*External)(nil), // 1: External
(*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
}
var file_base_proto_depIdxs = []int32{
1, // 0: BaseKey.expire:type_name -> google.protobuf.Timestamp
2, // 0: BaseKey.expire:type_name -> google.protobuf.Timestamp
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@ -144,6 +184,18 @@ func file_base_proto_init() {
return nil
}
}
file_base_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*External); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -151,7 +203,7 @@ func file_base_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_base_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -267,7 +267,8 @@ type SDiffResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Resluts []string `protobuf:"bytes,2,rep,name=resluts,proto3" json:"resluts,omitempty"`
E *External `protobuf:"bytes,1,opt,name=e,proto3" json:"e,omitempty"`
Result []string `protobuf:"bytes,2,rep,name=result,proto3" json:"result,omitempty"`
}
func (x *SDiffResponse) Reset() {
@ -302,9 +303,16 @@ func (*SDiffResponse) Descriptor() ([]byte, []int) {
return file_setx_proto_rawDescGZIP(), []int{5}
}
func (x *SDiffResponse) GetResluts() []string {
func (x *SDiffResponse) GetE() *External {
if x != nil {
return x.Resluts
return x.E
}
return nil
}
func (x *SDiffResponse) GetResult() []string {
if x != nil {
return x.Result
}
return nil
}
@ -376,6 +384,8 @@ type SDiffStoreResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
E *External `protobuf:"bytes,1,opt,name=e,proto3" json:"e,omitempty"` //加上 External 表示这个接口的返回值会对外调用
}
func (x *SDiffStoreResponse) Reset() {
@ -410,6 +420,13 @@ func (*SDiffStoreResponse) Descriptor() ([]byte, []int) {
return file_setx_proto_rawDescGZIP(), []int{7}
}
func (x *SDiffStoreResponse) GetE() *External {
if x != nil {
return x.E
}
return nil
}
type SInterRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -470,7 +487,8 @@ type SInterResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Resluts []string `protobuf:"bytes,2,rep,name=resluts,proto3" json:"resluts,omitempty"`
E *External `protobuf:"bytes,1,opt,name=e,proto3" json:"e,omitempty"`
Result []string `protobuf:"bytes,2,rep,name=result,proto3" json:"result,omitempty"`
}
func (x *SInterResponse) Reset() {
@ -505,9 +523,16 @@ func (*SInterResponse) Descriptor() ([]byte, []int) {
return file_setx_proto_rawDescGZIP(), []int{9}
}
func (x *SInterResponse) GetResluts() []string {
func (x *SInterResponse) GetE() *External {
if x != nil {
return x.Resluts
return x.E
}
return nil
}
func (x *SInterResponse) GetResult() []string {
if x != nil {
return x.Result
}
return nil
}
@ -579,6 +604,8 @@ type SInterStoreResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
E *External `protobuf:"bytes,1,opt,name=e,proto3" json:"e,omitempty"`
}
func (x *SInterStoreResponse) Reset() {
@ -613,6 +640,13 @@ func (*SInterStoreResponse) Descriptor() ([]byte, []int) {
return file_setx_proto_rawDescGZIP(), []int{11}
}
func (x *SInterStoreResponse) GetE() *External {
if x != nil {
return x.E
}
return nil
}
type SIsMemberRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -782,6 +816,8 @@ type SMoveResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
E *External `protobuf:"bytes,1,opt,name=e,proto3" json:"e,omitempty"`
}
func (x *SMoveResponse) Reset() {
@ -816,6 +852,13 @@ func (*SMoveResponse) Descriptor() ([]byte, []int) {
return file_setx_proto_rawDescGZIP(), []int{15}
}
func (x *SMoveResponse) GetE() *External {
if x != nil {
return x.E
}
return nil
}
type SPopRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -1071,7 +1114,8 @@ type SUnionResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Results []string `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
E *External `protobuf:"bytes,1,opt,name=e,proto3" json:"e,omitempty"`
Result []string `protobuf:"bytes,2,rep,name=result,proto3" json:"result,omitempty"`
}
func (x *SUnionResponse) Reset() {
@ -1106,9 +1150,16 @@ func (*SUnionResponse) Descriptor() ([]byte, []int) {
return file_setx_proto_rawDescGZIP(), []int{21}
}
func (x *SUnionResponse) GetResults() []string {
func (x *SUnionResponse) GetE() *External {
if x != nil {
return x.Results
return x.E
}
return nil
}
func (x *SUnionResponse) GetResult() []string {
if x != nil {
return x.Result
}
return nil
}
@ -1180,6 +1231,8 @@ type SUnionStoreResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
E *External `protobuf:"bytes,1,opt,name=e,proto3" json:"e,omitempty"`
}
func (x *SUnionStoreResponse) Reset() {
@ -1214,13 +1267,20 @@ func (*SUnionStoreResponse) Descriptor() ([]byte, []int) {
return file_setx_proto_rawDescGZIP(), []int{23}
}
func (x *SUnionStoreResponse) GetE() *External {
if x != nil {
return x.E
}
return nil
}
type SScanRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Key *BaseKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Sursor int32 `protobuf:"varint,2,opt,name=sursor,proto3" json:"sursor,omitempty"`
Cursor int32 `protobuf:"varint,2,opt,name=cursor,proto3" json:"cursor,omitempty"`
Regexp string `protobuf:"bytes,3,opt,name=regexp,proto3" json:"regexp,omitempty"`
Count int32 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"`
}
@ -1264,9 +1324,9 @@ func (x *SScanRequest) GetKey() *BaseKey {
return nil
}
func (x *SScanRequest) GetSursor() int32 {
func (x *SScanRequest) GetCursor() int32 {
if x != nil {
return x.Sursor
return x.Cursor
}
return 0
}
@ -1351,32 +1411,38 @@ var file_setx_proto_rawDesc = []byte{
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, 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, 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,
0x65, 0x79, 0x73, 0x22, 0x40, 0x0a, 0x0d, 0x53, 0x44, 0x69, 0x66, 0x66, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x01, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x09, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x01, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x72,
0x65, 0x73, 0x75, 0x6c, 0x74, 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, 0x2d, 0x0a, 0x12, 0x53, 0x44, 0x69, 0x66,
0x66, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17,
0x0a, 0x01, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x45, 0x78, 0x74, 0x65,
0x72, 0x6e, 0x61, 0x6c, 0x52, 0x01, 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, 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,
0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x22, 0x41, 0x0a, 0x0e, 0x53,
0x49, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a,
0x01, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72,
0x6e, 0x61, 0x6c, 0x52, 0x01, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 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, 0x2e, 0x0a, 0x13, 0x53, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x53, 0x74, 0x6f, 0x72,
0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x01, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52,
0x01, 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,
@ -1389,45 +1455,50 @@ var file_setx_proto_rawDesc = []byte{
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,
0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x28, 0x0a, 0x0d, 0x53, 0x4d, 0x6f, 0x76, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x01, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x09, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x01, 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, 0x41, 0x0a, 0x0e, 0x53, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x17, 0x0a, 0x01, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e,
0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x01, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72,
0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x73,
0x75, 0x6c, 0x74, 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,
0x73, 0x61, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x2e, 0x0a, 0x13, 0x53, 0x55, 0x6e, 0x69, 0x6f,
0x6e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17,
0x0a, 0x01, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x45, 0x78, 0x74, 0x65,
0x72, 0x6e, 0x61, 0x6c, 0x52, 0x01, 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, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x06, 0x63, 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 (
@ -1471,26 +1542,34 @@ var file_setx_proto_goTypes = []interface{}{
(*SScanRequest)(nil), // 24: SScanRequest
(*SScanResponse)(nil), // 25: SScanResponse
(*BaseKey)(nil), // 26: BaseKey
(*External)(nil), // 27: External
}
var file_setx_proto_depIdxs = []int32{
26, // 0: SAddRequest.key:type_name -> BaseKey
26, // 1: SCardRequest.key:type_name -> BaseKey
26, // 2: SDiffRequest.key:type_name -> BaseKey
26, // 3: SDiffStoreRequest.key:type_name -> BaseKey
26, // 4: SInterRequest.key:type_name -> BaseKey
26, // 5: SInterStoreRequest.key:type_name -> BaseKey
26, // 6: SIsMemberRequest.key:type_name -> BaseKey
26, // 7: SMoveRequest.key:type_name -> BaseKey
26, // 8: SPopRequest.key:type_name -> BaseKey
26, // 9: SRemRequest.key:type_name -> BaseKey
26, // 10: SUnionRequest.key:type_name -> BaseKey
26, // 11: SUnionStoreRequest.key:type_name -> BaseKey
26, // 12: SScanRequest.key:type_name -> BaseKey
13, // [13:13] is the sub-list for method output_type
13, // [13:13] is the sub-list for method input_type
13, // [13:13] is the sub-list for extension type_name
13, // [13:13] is the sub-list for extension extendee
0, // [0:13] is the sub-list for field type_name
27, // 3: SDiffResponse.e:type_name -> External
26, // 4: SDiffStoreRequest.key:type_name -> BaseKey
27, // 5: SDiffStoreResponse.e:type_name -> External
26, // 6: SInterRequest.key:type_name -> BaseKey
27, // 7: SInterResponse.e:type_name -> External
26, // 8: SInterStoreRequest.key:type_name -> BaseKey
27, // 9: SInterStoreResponse.e:type_name -> External
26, // 10: SIsMemberRequest.key:type_name -> BaseKey
26, // 11: SMoveRequest.key:type_name -> BaseKey
27, // 12: SMoveResponse.e:type_name -> External
26, // 13: SPopRequest.key:type_name -> BaseKey
26, // 14: SRemRequest.key:type_name -> BaseKey
26, // 15: SUnionRequest.key:type_name -> BaseKey
27, // 16: SUnionResponse.e:type_name -> External
26, // 17: SUnionStoreRequest.key:type_name -> BaseKey
27, // 18: SUnionStoreResponse.e:type_name -> External
26, // 19: SScanRequest.key:type_name -> BaseKey
20, // [20:20] is the sub-list for method output_type
20, // [20:20] is the sub-list for method input_type
20, // [20:20] is the sub-list for extension type_name
20, // [20:20] is the sub-list for extension extendee
0, // [0:20] is the sub-list for field type_name
}
func init() { file_setx_proto_init() }

View File

@ -7,4 +7,8 @@ message BaseKey {
string key = 1;
int64 ttl = 2;
google.protobuf.Timestamp expire = 3;
}
message External {
}

View File

@ -24,7 +24,8 @@ message SDiffRequest {
}
message SDiffResponse {
repeated string resluts = 2;
External e = 1;
repeated string result = 2;
}
message SDiffStoreRequest {
@ -34,6 +35,7 @@ message SDiffStoreRequest {
}
message SDiffStoreResponse {
External e = 1; // External
}
message SInterRequest {
@ -42,7 +44,8 @@ message SInterRequest {
}
message SInterResponse {
repeated string resluts = 2;
External e = 1;
repeated string result = 2;
}
message SInterStoreRequest {
@ -52,6 +55,7 @@ message SInterStoreRequest {
}
message SInterStoreResponse {
External e = 1;
}
message SIsMemberRequest {
@ -70,6 +74,7 @@ message SMoveRequest {
}
message SMoveResponse {
External e = 1;
}
message SPopRequest {
@ -95,7 +100,8 @@ message SUnionRequest {
}
message SUnionResponse {
repeated string results = 1;
External e = 1;
repeated string result = 2;
}
message SUnionStoreRequest {
@ -105,11 +111,12 @@ message SUnionStoreRequest {
}
message SUnionStoreResponse {
External e = 1;
}
message SScanRequest {
BaseKey key = 1;
int32 sursor = 2;
int32 cursor = 2;
string regexp = 3;
int32 count = 4;
}

View File

@ -17,6 +17,7 @@ class ProtoOption(object):
self.method = method
self.option = []
self.ret = []
self.external = False
def add_option(self, opt: List[str]):
self.option.extend(opt)
@ -38,10 +39,11 @@ def dist_to_ProOpt(req, resp) -> List[ProtoOption]:
def parse_type(l: str) -> List[str]:
l = l.strip()
if l == "":
return []
return [], False
opt = l.split(";")
result = []
f = False
for l_opt in opt:
l_opt = l_opt.strip()
l_list = l_opt.split()
@ -62,15 +64,23 @@ def dist_to_ProOpt(req, resp) -> List[ProtoOption]:
if len(resMap[0]) == 3:
mapKey, mapVal, var = resMap[0]
result.append([to_camel(var), f"map[{mapKey}]{mapVal}"])
elif "External" in val:
f = True
else:
result.append([to_camel(l_list[1]), val])
return result
return result, f
lists = []
for key, value in req.items():
p = ProtoOption(method=key)
p.add_option(parse_type(value))
p.add_ret(parse_type(resp.get(key, "")))
p.add_option(parse_type(value)[0])
ret, e = parse_type(resp.get(key, ""))
if e:
p.external = True
p.add_ret(ret)
lists.append(p)
return lists

View File

@ -153,7 +153,7 @@ func (d *Dao) ExecMessage(message protobuf.Message) error {
_, 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)
_, err := d.SScan(req.Key, req.Cursor, req.Regexp, req.Count)
return err
default:
return errorx.New("The type that is not registered exec err")

View File

@ -42,16 +42,16 @@ type Interface interface {
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)
SDiff(*proto.BaseKey, []string) (interface{}, error)
SDiffStore(*proto.BaseKey, []string, string) (interface{}, error)
SInter(*proto.BaseKey, []string) (interface{}, error)
SInterStore(*proto.BaseKey, []string, string) (interface{}, error)
SIsMember(*proto.BaseKey, string) (*proto.SIsMemberResponse, error)
SMove(*proto.BaseKey, string, []string) (*proto.SMoveResponse, error)
SMove(*proto.BaseKey, string, []string) (interface{}, 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)
SUnion(*proto.BaseKey, []string) (interface{}, error)
SUnionStore(*proto.BaseKey, []string, string) (interface{}, error)
SScan(*proto.BaseKey, int32, string, int32) (*proto.SScanResponse, error)
ExecMessage(message protobuf.Message) error
}

View File

@ -1219,7 +1219,7 @@ func (s *singleService) SScan(
req *proto.SScanRequest,
) (*proto.SScanResponse, error) {
work := event2.EventWorkFunc(func() (interface{}, error) {
resp, err := s.dao.SScan(req.Key, req.Sursor, req.Regexp, req.Count)
resp, err := s.dao.SScan(req.Key, req.Cursor, req.Regexp, req.Count)
if err != nil {
return nil, err
}

View File

@ -10,7 +10,7 @@ import (
type Interface interface {
{%for key in keys %}
{{key.method}}({% for req in key.option %} {{req[1]}}, {% endfor %}) (*proto.{{key.method}}Response, error)
{{key.method}}({% for req in key.option %} {{req[1]}}, {% endfor %}) ({% if key.external == False %} *proto.{{key.method}}Response {% else %} interface{} {% endif %}, error)
{%- endfor %}
ExecMessage(message protobuf.Message) error
}