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

// 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, 0x94, 0xd9, 0x7d, 0xf7, 0x3b, 0x70, 0x0e, 0x17, 0x2e, 0x0f,
0x6e, 0x18, 0x83, 0x6f, 0xe2, 0x10, 0x8e, 0x01, 0xab, 0x68, 0xd7, 0x01, 0xf8, 0xec, 0x10, 0x81,
0xf9, 0xae, 0x77, 0x92, 0x28, 0xa2, 0x6b, 0x93, 0x19, 0x05, 0xd0, 0xee, 0xcb, 0xc9, 0x4a, 0x11,
0x7d, 0x6e, 0x12, 0xe2, 0x2d, 0x70, 0xd7, 0x77, 0x3f, 0xbf, 0xa3, 0xa4, 0x8a, 0xea, 0xda, 0x94,
0x0b, 0xef, 0x81, 0xc7, 0xef, 0xe0, 0xdd, 0x28, 0x99, 0xa2, 0x7a, 0xb5, 0x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