You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
6.0 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: Person.proto
  3. package pb
  4. import (
  5. fmt "fmt"
  6. proto "github.com/golang/protobuf/proto"
  7. math "math"
  8. )
  9. // Reference imports to suppress errors if they are not otherwise used.
  10. var _ = proto.Marshal
  11. var _ = fmt.Errorf
  12. var _ = math.Inf
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the proto package it is being compiled against.
  15. // A compilation error at this line likely means your copy of the
  16. // proto package needs to be updated.
  17. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
  18. //enum为关键字,作用为定义一种枚举类型
  19. type PhoneType int32
  20. const (
  21. PhoneType_MOBILE PhoneType = 0
  22. PhoneType_HOME PhoneType = 1
  23. PhoneType_WORK PhoneType = 2
  24. )
  25. var PhoneType_name = map[int32]string{
  26. 0: "MOBILE",
  27. 1: "HOME",
  28. 2: "WORK",
  29. }
  30. var PhoneType_value = map[string]int32{
  31. "MOBILE": 0,
  32. "HOME": 1,
  33. "WORK": 2,
  34. }
  35. func (x PhoneType) String() string {
  36. return proto.EnumName(PhoneType_name, int32(x))
  37. }
  38. func (PhoneType) EnumDescriptor() ([]byte, []int) {
  39. return fileDescriptor_841ab6396175eaf3, []int{0}
  40. }
  41. //message为关键字,作用为定义一种消息类型
  42. type Person struct {
  43. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
  44. Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"`
  45. Emails []string `protobuf:"bytes,3,rep,name=emails,proto3" json:"emails,omitempty"`
  46. Phones []*PhoneNumber `protobuf:"bytes,4,rep,name=phones,proto3" json:"phones,omitempty"`
  47. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  48. XXX_unrecognized []byte `json:"-"`
  49. XXX_sizecache int32 `json:"-"`
  50. }
  51. func (m *Person) Reset() { *m = Person{} }
  52. func (m *Person) String() string { return proto.CompactTextString(m) }
  53. func (*Person) ProtoMessage() {}
  54. func (*Person) Descriptor() ([]byte, []int) {
  55. return fileDescriptor_841ab6396175eaf3, []int{0}
  56. }
  57. func (m *Person) XXX_Unmarshal(b []byte) error {
  58. return xxx_messageInfo_Person.Unmarshal(m, b)
  59. }
  60. func (m *Person) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  61. return xxx_messageInfo_Person.Marshal(b, m, deterministic)
  62. }
  63. func (m *Person) XXX_Merge(src proto.Message) {
  64. xxx_messageInfo_Person.Merge(m, src)
  65. }
  66. func (m *Person) XXX_Size() int {
  67. return xxx_messageInfo_Person.Size(m)
  68. }
  69. func (m *Person) XXX_DiscardUnknown() {
  70. xxx_messageInfo_Person.DiscardUnknown(m)
  71. }
  72. var xxx_messageInfo_Person proto.InternalMessageInfo
  73. func (m *Person) GetName() string {
  74. if m != nil {
  75. return m.Name
  76. }
  77. return ""
  78. }
  79. func (m *Person) GetAge() int32 {
  80. if m != nil {
  81. return m.Age
  82. }
  83. return 0
  84. }
  85. func (m *Person) GetEmails() []string {
  86. if m != nil {
  87. return m.Emails
  88. }
  89. return nil
  90. }
  91. func (m *Person) GetPhones() []*PhoneNumber {
  92. if m != nil {
  93. return m.Phones
  94. }
  95. return nil
  96. }
  97. //message为关键字,作用为定义一种消息类型可以被另外的消息类型嵌套使用
  98. type PhoneNumber struct {
  99. Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"`
  100. Type PhoneType `protobuf:"varint,2,opt,name=type,proto3,enum=pb.PhoneType" json:"type,omitempty"`
  101. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  102. XXX_unrecognized []byte `json:"-"`
  103. XXX_sizecache int32 `json:"-"`
  104. }
  105. func (m *PhoneNumber) Reset() { *m = PhoneNumber{} }
  106. func (m *PhoneNumber) String() string { return proto.CompactTextString(m) }
  107. func (*PhoneNumber) ProtoMessage() {}
  108. func (*PhoneNumber) Descriptor() ([]byte, []int) {
  109. return fileDescriptor_841ab6396175eaf3, []int{1}
  110. }
  111. func (m *PhoneNumber) XXX_Unmarshal(b []byte) error {
  112. return xxx_messageInfo_PhoneNumber.Unmarshal(m, b)
  113. }
  114. func (m *PhoneNumber) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  115. return xxx_messageInfo_PhoneNumber.Marshal(b, m, deterministic)
  116. }
  117. func (m *PhoneNumber) XXX_Merge(src proto.Message) {
  118. xxx_messageInfo_PhoneNumber.Merge(m, src)
  119. }
  120. func (m *PhoneNumber) XXX_Size() int {
  121. return xxx_messageInfo_PhoneNumber.Size(m)
  122. }
  123. func (m *PhoneNumber) XXX_DiscardUnknown() {
  124. xxx_messageInfo_PhoneNumber.DiscardUnknown(m)
  125. }
  126. var xxx_messageInfo_PhoneNumber proto.InternalMessageInfo
  127. func (m *PhoneNumber) GetNumber() string {
  128. if m != nil {
  129. return m.Number
  130. }
  131. return ""
  132. }
  133. func (m *PhoneNumber) GetType() PhoneType {
  134. if m != nil {
  135. return m.Type
  136. }
  137. return PhoneType_MOBILE
  138. }
  139. func init() {
  140. proto.RegisterEnum("pb.PhoneType", PhoneType_name, PhoneType_value)
  141. proto.RegisterType((*Person)(nil), "pb.Person")
  142. proto.RegisterType((*PhoneNumber)(nil), "pb.PhoneNumber")
  143. }
  144. func init() { proto.RegisterFile("Person.proto", fileDescriptor_841ab6396175eaf3) }
  145. var fileDescriptor_841ab6396175eaf3 = []byte{
  146. // 209 bytes of a gzipped FileDescriptorProto
  147. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8f, 0xcd, 0x4a, 0xc4, 0x30,
  148. 0x14, 0x85, 0x4d, 0x13, 0x83, 0xbd, 0xe3, 0x4f, 0xb8, 0x0b, 0xc9, 0x32, 0xce, 0xc6, 0xa0, 0xd0,
  149. 0xc5, 0xf8, 0x06, 0xc2, 0xc0, 0x88, 0x8e, 0x1d, 0x82, 0xe0, 0xba, 0x81, 0xa0, 0x82, 0x4d, 0x42,
  150. 0x3b, 0x2e, 0xfa, 0xf6, 0x92, 0x34, 0x94, 0xd9, 0x7d, 0xf7, 0x3b, 0x70, 0x0e, 0x17, 0x2e, 0x0f,
  151. 0x6e, 0x18, 0x83, 0x6f, 0xe2, 0x10, 0x8e, 0x01, 0xab, 0x68, 0xd7, 0x01, 0xf8, 0xec, 0x10, 0x81,
  152. 0xf9, 0xae, 0x77, 0x92, 0x28, 0xa2, 0x6b, 0x93, 0x19, 0x05, 0xd0, 0xee, 0xcb, 0xc9, 0x4a, 0x11,
  153. 0x7d, 0x6e, 0x12, 0xe2, 0x2d, 0x70, 0xd7, 0x77, 0x3f, 0xbf, 0xa3, 0xa4, 0x8a, 0xea, 0xda, 0x94,
  154. 0x0b, 0xef, 0x81, 0xc7, 0xef, 0xe0, 0xdd, 0x28, 0x99, 0xa2, 0x7a, 0xb5, 0xb9, 0x69, 0xa2, 0x6d,
  155. 0x0e, 0xc9, 0xbc, 0xff, 0xf5, 0xd6, 0x0d, 0xa6, 0xc4, 0xeb, 0x1d, 0xac, 0x4e, 0x74, 0xea, 0xf3,
  156. 0x99, 0xca, 0x6e, 0xb9, 0xf0, 0x0e, 0xd8, 0x71, 0x8a, 0xf3, 0xf4, 0xf5, 0xe6, 0x6a, 0x69, 0xfb,
  157. 0x98, 0xa2, 0x33, 0x39, 0x7a, 0x78, 0x84, 0x7a, 0x51, 0x08, 0xc0, 0xf7, 0xed, 0xf3, 0xcb, 0xdb,
  158. 0x56, 0x9c, 0xe1, 0x05, 0xb0, 0x5d, 0xbb, 0xdf, 0x0a, 0x92, 0xe8, 0xb3, 0x35, 0xaf, 0xa2, 0xb2,
  159. 0x3c, 0xbf, 0xfc, 0xf4, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xdf, 0x3c, 0xf1, 0xb8, 0x02, 0x01, 0x00,
  160. 0x00,
  161. }