// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.24.0 // protoc v3.12.1 // source: protocol.proto package protocol import ( proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // This is a compile-time assertion that a sufficiently up-to-date version // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 type ClassName int32 const ( ClassName_class1 ClassName = 0 //标号 必须从 0开始 ClassName_class2 ClassName = 1 ClassName_class3 ClassName = 2 ) // Enum value maps for ClassName. var ( ClassName_name = map[int32]string{ 0: "class1", 1: "class2", 2: "class3", } ClassName_value = map[string]int32{ "class1": 0, "class2": 1, "class3": 2, } ) func (x ClassName) Enum() *ClassName { p := new(ClassName) *p = x return p } func (x ClassName) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } func (ClassName) Descriptor() protoreflect.EnumDescriptor { return file_protocol_proto_enumTypes[0].Descriptor() } func (ClassName) Type() protoreflect.EnumType { return &file_protocol_proto_enumTypes[0] } func (x ClassName) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } // Deprecated: Use ClassName.Descriptor instead. func (ClassName) EnumDescriptor() ([]byte, []int) { return file_protocol_proto_rawDescGZIP(), []int{0} } type Student struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //1:标号,唯一 即可(相当于数据库中的Id,不一定要从1 ,2的顺序依次排列。) Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` //必须指定整型的范围,如int32,int64 Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` Cn ClassName `protobuf:"varint,4,opt,name=cn,proto3,enum=protocol.ClassName" json:"cn,omitempty"` } func (x *Student) Reset() { *x = Student{} if protoimpl.UnsafeEnabled { mi := &file_protocol_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Student) String() string { return protoimpl.X.MessageStringOf(x) } func (*Student) ProtoMessage() {} func (x *Student) ProtoReflect() protoreflect.Message { mi := &file_protocol_proto_msgTypes[0] 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 Student.ProtoReflect.Descriptor instead. func (*Student) Descriptor() ([]byte, []int) { return file_protocol_proto_rawDescGZIP(), []int{0} } func (x *Student) GetName() string { if x != nil { return x.Name } return "" } func (x *Student) GetAge() int32 { if x != nil { return x.Age } return 0 } func (x *Student) GetAddress() string { if x != nil { return x.Address } return "" } func (x *Student) GetCn() ClassName { if x != nil { return x.Cn } return ClassName_class1 } type Students struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Person []*Student `protobuf:"bytes,1,rep,name=person,proto3" json:"person,omitempty"` // repeated 修饰,相当于Go中切片 School string `protobuf:"bytes,2,opt,name=school,proto3" json:"school,omitempty"` } func (x *Students) Reset() { *x = Students{} if protoimpl.UnsafeEnabled { mi := &file_protocol_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Students) String() string { return protoimpl.X.MessageStringOf(x) } func (*Students) ProtoMessage() {} func (x *Students) ProtoReflect() protoreflect.Message { mi := &file_protocol_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 Students.ProtoReflect.Descriptor instead. func (*Students) Descriptor() ([]byte, []int) { return file_protocol_proto_rawDescGZIP(), []int{1} } func (x *Students) GetPerson() []*Student { if x != nil { return x.Person } return nil } func (x *Students) GetSchool() string { if x != nil { return x.School } return "" } var File_protocol_proto protoreflect.FileDescriptor var file_protocol_proto_rawDesc = []byte{ 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x6e, 0x0a, 0x07, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a, 0x02, 0x63, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x02, 0x63, 0x6e, 0x22, 0x4d, 0x0a, 0x08, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x6f, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x6f, 0x6f, 0x6c, 0x2a, 0x2f, 0x0a, 0x09, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x31, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x32, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x33, 0x10, 0x02, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_protocol_proto_rawDescOnce sync.Once file_protocol_proto_rawDescData = file_protocol_proto_rawDesc ) func file_protocol_proto_rawDescGZIP() []byte { file_protocol_proto_rawDescOnce.Do(func() { file_protocol_proto_rawDescData = protoimpl.X.CompressGZIP(file_protocol_proto_rawDescData) }) return file_protocol_proto_rawDescData } var file_protocol_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_protocol_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_protocol_proto_goTypes = []interface{}{ (ClassName)(0), // 0: protocol.ClassName (*Student)(nil), // 1: protocol.Student (*Students)(nil), // 2: protocol.Students } var file_protocol_proto_depIdxs = []int32{ 0, // 0: protocol.Student.cn:type_name -> protocol.ClassName 1, // 1: protocol.Students.person:type_name -> protocol.Student 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name } func init() { file_protocol_proto_init() } func file_protocol_proto_init() { if File_protocol_proto != nil { return } if !protoimpl.UnsafeEnabled { file_protocol_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Student); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_protocol_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Students); 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{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protocol_proto_rawDesc, NumEnums: 1, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, GoTypes: file_protocol_proto_goTypes, DependencyIndexes: file_protocol_proto_depIdxs, EnumInfos: file_protocol_proto_enumTypes, MessageInfos: file_protocol_proto_msgTypes, }.Build() File_protocol_proto = out.File file_protocol_proto_rawDesc = nil file_protocol_proto_goTypes = nil file_protocol_proto_depIdxs = nil }