| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- // Code generated by protoc-gen-go. DO NOT EDIT.
- // versions:
- // protoc-gen-go v1.24.0
- // protoc v3.12.1
- // source: student.proto
- package student
- 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_student_proto_enumTypes[0].Descriptor()
- }
- func (ClassName) Type() protoreflect.EnumType {
- return &file_student_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_student_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=student.ClassName" json:"cn,omitempty"`
- }
- func (x *Student) Reset() {
- *x = Student{}
- if protoimpl.UnsafeEnabled {
- mi := &file_student_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_student_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_student_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_student_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_student_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_student_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_student_proto protoreflect.FileDescriptor
- var file_student_proto_rawDesc = []byte{
- 0x0a, 0x0d, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
- 0x07, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x22, 0x6d, 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, 0x22, 0x0a, 0x02, 0x63, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x12, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e,
- 0x61, 0x6d, 0x65, 0x52, 0x02, 0x63, 0x6e, 0x22, 0x4c, 0x0a, 0x08, 0x53, 0x74, 0x75, 0x64, 0x65,
- 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20,
- 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 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, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x3b, 0x73, 0x74, 0x75, 0x64,
- 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
- }
- var (
- file_student_proto_rawDescOnce sync.Once
- file_student_proto_rawDescData = file_student_proto_rawDesc
- )
- func file_student_proto_rawDescGZIP() []byte {
- file_student_proto_rawDescOnce.Do(func() {
- file_student_proto_rawDescData = protoimpl.X.CompressGZIP(file_student_proto_rawDescData)
- })
- return file_student_proto_rawDescData
- }
- var file_student_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
- var file_student_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
- var file_student_proto_goTypes = []interface{}{
- (ClassName)(0), // 0: student.ClassName
- (*Student)(nil), // 1: student.Student
- (*Students)(nil), // 2: student.Students
- }
- var file_student_proto_depIdxs = []int32{
- 0, // 0: student.Student.cn:type_name -> student.ClassName
- 1, // 1: student.Students.person:type_name -> student.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_student_proto_init() }
- func file_student_proto_init() {
- if File_student_proto != nil {
- return
- }
- if !protoimpl.UnsafeEnabled {
- file_student_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_student_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_student_proto_rawDesc,
- NumEnums: 1,
- NumMessages: 2,
- NumExtensions: 0,
- NumServices: 0,
- },
- GoTypes: file_student_proto_goTypes,
- DependencyIndexes: file_student_proto_depIdxs,
- EnumInfos: file_student_proto_enumTypes,
- MessageInfos: file_student_proto_msgTypes,
- }.Build()
- File_student_proto = out.File
- file_student_proto_rawDesc = nil
- file_student_proto_goTypes = nil
- file_student_proto_depIdxs = nil
- }
|