student.pb.go 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.24.0
  4. // protoc v3.12.1
  5. // source: student.proto
  6. package student
  7. import (
  8. proto "github.com/golang/protobuf/proto"
  9. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  10. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  11. reflect "reflect"
  12. sync "sync"
  13. )
  14. const (
  15. // Verify that this generated code is sufficiently up-to-date.
  16. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  17. // Verify that runtime/protoimpl is sufficiently up-to-date.
  18. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  19. )
  20. // This is a compile-time assertion that a sufficiently up-to-date version
  21. // of the legacy proto package is being used.
  22. const _ = proto.ProtoPackageIsVersion4
  23. type ClassName int32
  24. const (
  25. ClassName_class1 ClassName = 0 //标号 必须从 0开始
  26. ClassName_class2 ClassName = 1
  27. ClassName_class3 ClassName = 2
  28. )
  29. // Enum value maps for ClassName.
  30. var (
  31. ClassName_name = map[int32]string{
  32. 0: "class1",
  33. 1: "class2",
  34. 2: "class3",
  35. }
  36. ClassName_value = map[string]int32{
  37. "class1": 0,
  38. "class2": 1,
  39. "class3": 2,
  40. }
  41. )
  42. func (x ClassName) Enum() *ClassName {
  43. p := new(ClassName)
  44. *p = x
  45. return p
  46. }
  47. func (x ClassName) String() string {
  48. return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
  49. }
  50. func (ClassName) Descriptor() protoreflect.EnumDescriptor {
  51. return file_student_proto_enumTypes[0].Descriptor()
  52. }
  53. func (ClassName) Type() protoreflect.EnumType {
  54. return &file_student_proto_enumTypes[0]
  55. }
  56. func (x ClassName) Number() protoreflect.EnumNumber {
  57. return protoreflect.EnumNumber(x)
  58. }
  59. // Deprecated: Use ClassName.Descriptor instead.
  60. func (ClassName) EnumDescriptor() ([]byte, []int) {
  61. return file_student_proto_rawDescGZIP(), []int{0}
  62. }
  63. type Student struct {
  64. state protoimpl.MessageState
  65. sizeCache protoimpl.SizeCache
  66. unknownFields protoimpl.UnknownFields
  67. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` //1:标号,唯一 即可(相当于数据库中的Id,不一定要从1 ,2的顺序依次排列。)
  68. Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` //必须指定整型的范围,如int32,int64
  69. Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`
  70. Cn ClassName `protobuf:"varint,4,opt,name=cn,proto3,enum=student.ClassName" json:"cn,omitempty"`
  71. }
  72. func (x *Student) Reset() {
  73. *x = Student{}
  74. if protoimpl.UnsafeEnabled {
  75. mi := &file_student_proto_msgTypes[0]
  76. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  77. ms.StoreMessageInfo(mi)
  78. }
  79. }
  80. func (x *Student) String() string {
  81. return protoimpl.X.MessageStringOf(x)
  82. }
  83. func (*Student) ProtoMessage() {}
  84. func (x *Student) ProtoReflect() protoreflect.Message {
  85. mi := &file_student_proto_msgTypes[0]
  86. if protoimpl.UnsafeEnabled && x != nil {
  87. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  88. if ms.LoadMessageInfo() == nil {
  89. ms.StoreMessageInfo(mi)
  90. }
  91. return ms
  92. }
  93. return mi.MessageOf(x)
  94. }
  95. // Deprecated: Use Student.ProtoReflect.Descriptor instead.
  96. func (*Student) Descriptor() ([]byte, []int) {
  97. return file_student_proto_rawDescGZIP(), []int{0}
  98. }
  99. func (x *Student) GetName() string {
  100. if x != nil {
  101. return x.Name
  102. }
  103. return ""
  104. }
  105. func (x *Student) GetAge() int32 {
  106. if x != nil {
  107. return x.Age
  108. }
  109. return 0
  110. }
  111. func (x *Student) GetAddress() string {
  112. if x != nil {
  113. return x.Address
  114. }
  115. return ""
  116. }
  117. func (x *Student) GetCn() ClassName {
  118. if x != nil {
  119. return x.Cn
  120. }
  121. return ClassName_class1
  122. }
  123. type Students struct {
  124. state protoimpl.MessageState
  125. sizeCache protoimpl.SizeCache
  126. unknownFields protoimpl.UnknownFields
  127. Person []*Student `protobuf:"bytes,1,rep,name=person,proto3" json:"person,omitempty"` // repeated 修饰,相当于Go中切片
  128. School string `protobuf:"bytes,2,opt,name=school,proto3" json:"school,omitempty"`
  129. }
  130. func (x *Students) Reset() {
  131. *x = Students{}
  132. if protoimpl.UnsafeEnabled {
  133. mi := &file_student_proto_msgTypes[1]
  134. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  135. ms.StoreMessageInfo(mi)
  136. }
  137. }
  138. func (x *Students) String() string {
  139. return protoimpl.X.MessageStringOf(x)
  140. }
  141. func (*Students) ProtoMessage() {}
  142. func (x *Students) ProtoReflect() protoreflect.Message {
  143. mi := &file_student_proto_msgTypes[1]
  144. if protoimpl.UnsafeEnabled && x != nil {
  145. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  146. if ms.LoadMessageInfo() == nil {
  147. ms.StoreMessageInfo(mi)
  148. }
  149. return ms
  150. }
  151. return mi.MessageOf(x)
  152. }
  153. // Deprecated: Use Students.ProtoReflect.Descriptor instead.
  154. func (*Students) Descriptor() ([]byte, []int) {
  155. return file_student_proto_rawDescGZIP(), []int{1}
  156. }
  157. func (x *Students) GetPerson() []*Student {
  158. if x != nil {
  159. return x.Person
  160. }
  161. return nil
  162. }
  163. func (x *Students) GetSchool() string {
  164. if x != nil {
  165. return x.School
  166. }
  167. return ""
  168. }
  169. var File_student_proto protoreflect.FileDescriptor
  170. var file_student_proto_rawDesc = []byte{
  171. 0x0a, 0x0d, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
  172. 0x07, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x22, 0x6d, 0x0a, 0x07, 0x53, 0x74, 0x75, 0x64,
  173. 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
  174. 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x02,
  175. 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64,
  176. 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72,
  177. 0x65, 0x73, 0x73, 0x12, 0x22, 0x0a, 0x02, 0x63, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32,
  178. 0x12, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e,
  179. 0x61, 0x6d, 0x65, 0x52, 0x02, 0x63, 0x6e, 0x22, 0x4c, 0x0a, 0x08, 0x53, 0x74, 0x75, 0x64, 0x65,
  180. 0x6e, 0x74, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x18, 0x01, 0x20,
  181. 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74,
  182. 0x75, 0x64, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x70, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x16, 0x0a,
  183. 0x06, 0x73, 0x63, 0x68, 0x6f, 0x6f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73,
  184. 0x63, 0x68, 0x6f, 0x6f, 0x6c, 0x2a, 0x2f, 0x0a, 0x09, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61,
  185. 0x6d, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x31, 0x10, 0x00, 0x12, 0x0a,
  186. 0x0a, 0x06, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x32, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x6c,
  187. 0x61, 0x73, 0x73, 0x33, 0x10, 0x02, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x3b, 0x73, 0x74, 0x75, 0x64,
  188. 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
  189. }
  190. var (
  191. file_student_proto_rawDescOnce sync.Once
  192. file_student_proto_rawDescData = file_student_proto_rawDesc
  193. )
  194. func file_student_proto_rawDescGZIP() []byte {
  195. file_student_proto_rawDescOnce.Do(func() {
  196. file_student_proto_rawDescData = protoimpl.X.CompressGZIP(file_student_proto_rawDescData)
  197. })
  198. return file_student_proto_rawDescData
  199. }
  200. var file_student_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
  201. var file_student_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
  202. var file_student_proto_goTypes = []interface{}{
  203. (ClassName)(0), // 0: student.ClassName
  204. (*Student)(nil), // 1: student.Student
  205. (*Students)(nil), // 2: student.Students
  206. }
  207. var file_student_proto_depIdxs = []int32{
  208. 0, // 0: student.Student.cn:type_name -> student.ClassName
  209. 1, // 1: student.Students.person:type_name -> student.Student
  210. 2, // [2:2] is the sub-list for method output_type
  211. 2, // [2:2] is the sub-list for method input_type
  212. 2, // [2:2] is the sub-list for extension type_name
  213. 2, // [2:2] is the sub-list for extension extendee
  214. 0, // [0:2] is the sub-list for field type_name
  215. }
  216. func init() { file_student_proto_init() }
  217. func file_student_proto_init() {
  218. if File_student_proto != nil {
  219. return
  220. }
  221. if !protoimpl.UnsafeEnabled {
  222. file_student_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  223. switch v := v.(*Student); i {
  224. case 0:
  225. return &v.state
  226. case 1:
  227. return &v.sizeCache
  228. case 2:
  229. return &v.unknownFields
  230. default:
  231. return nil
  232. }
  233. }
  234. file_student_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  235. switch v := v.(*Students); i {
  236. case 0:
  237. return &v.state
  238. case 1:
  239. return &v.sizeCache
  240. case 2:
  241. return &v.unknownFields
  242. default:
  243. return nil
  244. }
  245. }
  246. }
  247. type x struct{}
  248. out := protoimpl.TypeBuilder{
  249. File: protoimpl.DescBuilder{
  250. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  251. RawDescriptor: file_student_proto_rawDesc,
  252. NumEnums: 1,
  253. NumMessages: 2,
  254. NumExtensions: 0,
  255. NumServices: 0,
  256. },
  257. GoTypes: file_student_proto_goTypes,
  258. DependencyIndexes: file_student_proto_depIdxs,
  259. EnumInfos: file_student_proto_enumTypes,
  260. MessageInfos: file_student_proto_msgTypes,
  261. }.Build()
  262. File_student_proto = out.File
  263. file_student_proto_rawDesc = nil
  264. file_student_proto_goTypes = nil
  265. file_student_proto_depIdxs = nil
  266. }