mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-24 20:52:22 +00:00
175 lines
6.5 KiB
Go
175 lines
6.5 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: helloworld.proto
|
|
|
|
package main // import "main"
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
import descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
|
|
|
|
// 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.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
type Message0 struct {
|
|
Name *string `protobuf:"bytes,1,opt,name=name,def=gopher" json:"name,omitempty"`
|
|
Age *int32 `protobuf:"varint,2,opt,name=age,def=10" json:"age,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Message0) Reset() { *m = Message0{} }
|
|
func (m *Message0) String() string { return proto.CompactTextString(m) }
|
|
func (*Message0) ProtoMessage() {}
|
|
func (*Message0) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_helloworld_a2a557ac07ecc4b1, []int{0}
|
|
}
|
|
func (m *Message0) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Message0.Unmarshal(m, b)
|
|
}
|
|
func (m *Message0) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Message0.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *Message0) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Message0.Merge(dst, src)
|
|
}
|
|
func (m *Message0) XXX_Size() int {
|
|
return xxx_messageInfo_Message0.Size(m)
|
|
}
|
|
func (m *Message0) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Message0.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Message0 proto.InternalMessageInfo
|
|
|
|
const Default_Message0_Name string = "gopher"
|
|
const Default_Message0_Age int32 = 10
|
|
|
|
func (m *Message0) GetName() string {
|
|
if m != nil && m.Name != nil {
|
|
return *m.Name
|
|
}
|
|
return Default_Message0_Name
|
|
}
|
|
|
|
func (m *Message0) GetAge() int32 {
|
|
if m != nil && m.Age != nil {
|
|
return *m.Age
|
|
}
|
|
return Default_Message0_Age
|
|
}
|
|
|
|
type Message2 struct {
|
|
Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
|
|
Age *int32 `protobuf:"varint,2,opt,name=age" json:"age,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Message2) Reset() { *m = Message2{} }
|
|
func (m *Message2) String() string { return proto.CompactTextString(m) }
|
|
func (*Message2) ProtoMessage() {}
|
|
func (*Message2) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_helloworld_a2a557ac07ecc4b1, []int{1}
|
|
}
|
|
func (m *Message2) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Message2.Unmarshal(m, b)
|
|
}
|
|
func (m *Message2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Message2.Marshal(b, m, deterministic)
|
|
}
|
|
func (dst *Message2) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Message2.Merge(dst, src)
|
|
}
|
|
func (m *Message2) XXX_Size() int {
|
|
return xxx_messageInfo_Message2.Size(m)
|
|
}
|
|
func (m *Message2) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Message2.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Message2 proto.InternalMessageInfo
|
|
|
|
func (m *Message2) GetName() string {
|
|
if m != nil && m.Name != nil {
|
|
return *m.Name
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message2) GetAge() int32 {
|
|
if m != nil && m.Age != nil {
|
|
return *m.Age
|
|
}
|
|
return 0
|
|
}
|
|
|
|
var E_Email = &proto.ExtensionDesc{
|
|
ExtendedType: (*descriptor.FileOptions)(nil),
|
|
ExtensionType: (*string)(nil),
|
|
Field: 50000,
|
|
Name: "main.email",
|
|
Tag: "bytes,50000,opt,name=email",
|
|
Filename: "helloworld.proto",
|
|
}
|
|
|
|
var E_DefaultString = &proto.ExtensionDesc{
|
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
|
ExtensionType: (*string)(nil),
|
|
Field: 50000,
|
|
Name: "main.default_string",
|
|
Tag: "bytes,50000,opt,name=default_string,json=defaultString",
|
|
Filename: "helloworld.proto",
|
|
}
|
|
|
|
var E_DefaultInt = &proto.ExtensionDesc{
|
|
ExtendedType: (*descriptor.FieldOptions)(nil),
|
|
ExtensionType: (*int32)(nil),
|
|
Field: 50001,
|
|
Name: "main.default_int",
|
|
Tag: "varint,50001,opt,name=default_int,json=defaultInt",
|
|
Filename: "helloworld.proto",
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Message0)(nil), "main.Message0")
|
|
proto.RegisterType((*Message2)(nil), "main.Message2")
|
|
proto.RegisterExtension(E_Email)
|
|
proto.RegisterExtension(E_DefaultString)
|
|
proto.RegisterExtension(E_DefaultInt)
|
|
}
|
|
|
|
func init() { proto.RegisterFile("helloworld.proto", fileDescriptor_helloworld_a2a557ac07ecc4b1) }
|
|
|
|
var fileDescriptor_helloworld_a2a557ac07ecc4b1 = []byte{
|
|
// 284 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0x41, 0x4b, 0xc3, 0x30,
|
|
0x18, 0x86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