forked from aceld/zinx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Person.pb.go
188 lines (161 loc) · 5.99 KB
/
Person.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: Person.proto
package pb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
//enum为关键字,作用为定义一种枚举类型
type PhoneType int32
const (
PhoneType_MOBILE PhoneType = 0
PhoneType_HOME PhoneType = 1
PhoneType_WORK PhoneType = 2
)
var PhoneType_name = map[int32]string{
0: "MOBILE",
1: "HOME",
2: "WORK",
}
var PhoneType_value = map[string]int32{
"MOBILE": 0,
"HOME": 1,
"WORK": 2,
}
func (x PhoneType) String() string {
return proto.EnumName(PhoneType_name, int32(x))
}
func (PhoneType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_841ab6396175eaf3, []int{0}
}
//message为关键字,作用为定义一种消息类型
type Person struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"`
Emails []string `protobuf:"bytes,3,rep,name=emails,proto3" json:"emails,omitempty"`
Phones []*PhoneNumber `protobuf:"bytes,4,rep,name=phones,proto3" json:"phones,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Person) Reset() { *m = Person{} }
func (m *Person) String() string { return proto.CompactTextString(m) }
func (*Person) ProtoMessage() {}
func (*Person) Descriptor() ([]byte, []int) {
return fileDescriptor_841ab6396175eaf3, []int{0}
}
func (m *Person) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Person.Unmarshal(m, b)
}
func (m *Person) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Person.Marshal(b, m, deterministic)
}
func (m *Person) XXX_Merge(src proto.Message) {
xxx_messageInfo_Person.Merge(m, src)
}
func (m *Person) XXX_Size() int {
return xxx_messageInfo_Person.Size(m)
}
func (m *Person) XXX_DiscardUnknown() {
xxx_messageInfo_Person.DiscardUnknown(m)
}
var xxx_messageInfo_Person proto.InternalMessageInfo
func (m *Person) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *Person) GetAge() int32 {
if m != nil {
return m.Age
}
return 0
}
func (m *Person) GetEmails() []string {
if m != nil {
return m.Emails
}
return nil
}
func (m *Person) GetPhones() []*PhoneNumber {
if m != nil {
return m.Phones
}
return nil
}
//message为关键字,作用为定义一种消息类型可以被另外的消息类型嵌套使用
type PhoneNumber struct {
Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"`
Type PhoneType `protobuf:"varint,2,opt,name=type,proto3,enum=pb.PhoneType" json:"type,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PhoneNumber) Reset() { *m = PhoneNumber{} }
func (m *PhoneNumber) String() string { return proto.CompactTextString(m) }
func (*PhoneNumber) ProtoMessage() {}
func (*PhoneNumber) Descriptor() ([]byte, []int) {
return fileDescriptor_841ab6396175eaf3, []int{1}
}
func (m *PhoneNumber) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PhoneNumber.Unmarshal(m, b)
}
func (m *PhoneNumber) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PhoneNumber.Marshal(b, m, deterministic)
}
func (m *PhoneNumber) XXX_Merge(src proto.Message) {
xxx_messageInfo_PhoneNumber.Merge(m, src)
}
func (m *PhoneNumber) XXX_Size() int {
return xxx_messageInfo_PhoneNumber.Size(m)
}
func (m *PhoneNumber) XXX_DiscardUnknown() {
xxx_messageInfo_PhoneNumber.DiscardUnknown(m)
}
var xxx_messageInfo_PhoneNumber proto.InternalMessageInfo
func (m *PhoneNumber) GetNumber() string {
if m != nil {
return m.Number
}
return ""
}
func (m *PhoneNumber) GetType() PhoneType {
if m != nil {
return m.Type
}
return PhoneType_MOBILE
}
func init() {
proto.RegisterEnum("pb.PhoneType", PhoneType_name, PhoneType_value)
proto.RegisterType((*Person)(nil), "pb.Person")
proto.RegisterType((*PhoneNumber)(nil), "pb.PhoneNumber")
}
func init() { proto.RegisterFile("Person.proto", fileDescriptor_841ab6396175eaf3) }
var fileDescriptor_841ab6396175eaf3 = []byte{
// 209 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8f, 0xcd, 0x4a, 0xc4, 0x30,
0x14, 0x85, 0x4d, 0x13, 0x83, 0xbd, 0xe3, 0x4f, 0xb8, 0x0b, 0xc9, 0x32, 0xce, 0xc6, 0xa0, 0xd0,
0xc5, 0xf8, 0x06, 0xc2, 0xc0, 0x88, 0x8e, 0x1d, 0x82, 0xe0, 0xba, 0x81, 0xa0, 0x82, 0x4d, 0x42,
0x3b, 0x2e, 0xfa, 0xf6, 0x92, 0x34, 0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