mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-17 10:11:58 +00:00
b6405bd782
Implement support in protoc-gen-go for generating messages and enums that satisfy the v2 protobuf reflection interfaces. Specifically, the following are added: * top-level variable representing the file descriptor * ProtoReflect method on enums (to implement protoV2.Enum) * ProtoReflect method on messages (to implement protoV2.Message) The following are not supported yet: * resolving transitive dependencies for file imports * Extension descriptors * Service descriptors The implementation approach creates a single array for all the message and enum declarations and references sections of that array to complete dependencies. Since protobuf declarations can form a graph (a message may depend on itself), it is difficult to construct a graph as a single literal. One way is to use placeholder descriptors, but that is not efficient as it requires encoding the full name of each dependent enum and message and then later resolving it; thus, both expanding the binary size and also increasing initialization cost. Instead, we add a prototype.{Enum,Message}.Reference method to obtain a descriptor reference for the purposes for satisfying dependencies. As such, nested declarations and dependencies are populated in an init function. Other changes to support the implementation: * Added a protoimpl package to expose the MessageType type and also the MessageTypeOf and EnumTypeOf helper functions. * Added a protogen.File.GoIdent field to provide a suggested variable name for the file descriptor. * Added prototype.{Enum,Message}.Reference that provides a descriptor reference for the purposes for satisfying cyclic dependencies. * Added protoreflect.{Syntax,Cardinality,Kind}.GoString to obtain a Go source identifier that represents the given constant. Change-Id: I9455764882dee6ad10f251901e7d419091e8bf1d Reviewed-on: https://go-review.googlesource.com/c/150074 Reviewed-by: Damien Neil <dneil@google.com>
574 lines
18 KiB
Go
574 lines
18 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: fieldnames/fieldnames.proto
|
|
|
|
package fieldnames
|
|
|
|
import (
|
|
fmt "fmt"
|
|
proto "github.com/golang/protobuf/proto"
|
|
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
|
|
prototype "github.com/golang/protobuf/v2/reflect/prototype"
|
|
protoimpl "github.com/golang/protobuf/v2/runtime/protoimpl"
|
|
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
|
|
|
|
// Assorted edge cases in field name conflict resolution.
|
|
//
|
|
// Not all (or possibly any) of these behave in an easily-understood fashion.
|
|
// This exists to demonstrate the current behavior and catch unintended
|
|
// changes in it.
|
|
type Message struct {
|
|
// Various CamelCase conversions.
|
|
FieldOne *string `protobuf:"bytes,1,opt,name=field_one,json=fieldOne" json:"field_one,omitempty"`
|
|
FieldTwo *string `protobuf:"bytes,2,opt,name=FieldTwo" json:"FieldTwo,omitempty"`
|
|
FieldThree *string `protobuf:"bytes,3,opt,name=fieldThree" json:"fieldThree,omitempty"`
|
|
Field_Four *string `protobuf:"bytes,4,opt,name=field__four,json=fieldFour" json:"field__four,omitempty"`
|
|
// Field names that conflict with standard methods on the message struct.
|
|
Descriptor_ *string `protobuf:"bytes,10,opt,name=descriptor" json:"descriptor,omitempty"`
|
|
Marshal_ *string `protobuf:"bytes,11,opt,name=marshal" json:"marshal,omitempty"`
|
|
Unmarshal_ *string `protobuf:"bytes,12,opt,name=unmarshal" json:"unmarshal,omitempty"`
|
|
ProtoMessage_ *string `protobuf:"bytes,13,opt,name=proto_message,json=protoMessage" json:"proto_message,omitempty"`
|
|
// Field names that conflict with each other after CamelCasing.
|
|
CamelCase *string `protobuf:"bytes,20,opt,name=CamelCase" json:"CamelCase,omitempty"`
|
|
CamelCase_ *string `protobuf:"bytes,21,opt,name=CamelCase_,json=CamelCase" json:"CamelCase_,omitempty"`
|
|
CamelCase__ *string `protobuf:"bytes,22,opt,name=camel_case,json=camelCase" json:"camel_case,omitempty"`
|
|
CamelCase___ *string `protobuf:"bytes,23,opt,name=CamelCase__,json=CamelCase" json:"CamelCase__,omitempty"`
|
|
// Field with a getter that conflicts with another field.
|
|
GetName *string `protobuf:"bytes,30,opt,name=get_name,json=getName" json:"get_name,omitempty"`
|
|
Name_ *string `protobuf:"bytes,31,opt,name=name" json:"name,omitempty"`
|
|
// Oneof that conflicts with its first field: The oneof is renamed.
|
|
//
|
|
// Types that are valid to be assigned to OneofConflictA_:
|
|
// *Message_OneofConflictA
|
|
OneofConflictA_ isMessage_OneofConflictA_ `protobuf_oneof:"oneof_conflict_a"`
|
|
// Oneof that conflicts with its second field: The field is renamed.
|
|
//
|
|
// Types that are valid to be assigned to OneofConflictB:
|
|
// *Message_OneofNoConflict
|
|
// *Message_OneofConflictB_
|
|
OneofConflictB isMessage_OneofConflictB `protobuf_oneof:"oneof_conflict_b"`
|
|
// Oneof with a field name that conflicts with a nested message.
|
|
//
|
|
// Types that are valid to be assigned to OneofConflictC:
|
|
// *Message_OneofMessageConflict_
|
|
OneofConflictC isMessage_OneofConflictC `protobuf_oneof:"oneof_conflict_c"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
type xxx_Message struct{ m *Message }
|
|
|
|
func (m *Message) ProtoReflect() protoreflect.Message {
|
|
return xxx_Message{m}
|
|
}
|
|
func (m xxx_Message) Type() protoreflect.MessageType {
|
|
return xxx_Fieldnames_ProtoFile_MessageTypes[0].Type
|
|
}
|
|
func (m xxx_Message) KnownFields() protoreflect.KnownFields {
|
|
return xxx_Fieldnames_ProtoFile_MessageTypes[0].KnownFieldsOf(m.m)
|
|
}
|
|
func (m xxx_Message) UnknownFields() protoreflect.UnknownFields {
|
|
return xxx_Fieldnames_ProtoFile_MessageTypes[0].UnknownFieldsOf(m.m)
|
|
}
|
|
func (m xxx_Message) Interface() protoreflect.ProtoMessage {
|
|
return m.m
|
|
}
|
|
func (m xxx_Message) ProtoMutable() {}
|
|
|
|
func (m *Message) Reset() { *m = Message{} }
|
|
func (m *Message) String() string { return proto.CompactTextString(m) }
|
|
func (*Message) ProtoMessage() {}
|
|
func (*Message) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_6bbe3f70febb9403, []int{0}
|
|
}
|
|
|
|
func (m *Message) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Message.Unmarshal(m, b)
|
|
}
|
|
func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Message.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Message) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Message.Merge(m, src)
|
|
}
|
|
func (m *Message) XXX_Size() int {
|
|
return xxx_messageInfo_Message.Size(m)
|
|
}
|
|
func (m *Message) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Message.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Message proto.InternalMessageInfo
|
|
|
|
func (m *Message) GetFieldOne() string {
|
|
if m != nil && m.FieldOne != nil {
|
|
return *m.FieldOne
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetFieldTwo() string {
|
|
if m != nil && m.FieldTwo != nil {
|
|
return *m.FieldTwo
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetFieldThree() string {
|
|
if m != nil && m.FieldThree != nil {
|
|
return *m.FieldThree
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetField_Four() string {
|
|
if m != nil && m.Field_Four != nil {
|
|
return *m.Field_Four
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetDescriptor_() string {
|
|
if m != nil && m.Descriptor_ != nil {
|
|
return *m.Descriptor_
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetMarshal_() string {
|
|
if m != nil && m.Marshal_ != nil {
|
|
return *m.Marshal_
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetUnmarshal_() string {
|
|
if m != nil && m.Unmarshal_ != nil {
|
|
return *m.Unmarshal_
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetProtoMessage_() string {
|
|
if m != nil && m.ProtoMessage_ != nil {
|
|
return *m.ProtoMessage_
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetCamelCase() string {
|
|
if m != nil && m.CamelCase != nil {
|
|
return *m.CamelCase
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetCamelCase_() string {
|
|
if m != nil && m.CamelCase_ != nil {
|
|
return *m.CamelCase_
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetCamelCase__() string {
|
|
if m != nil && m.CamelCase__ != nil {
|
|
return *m.CamelCase__
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetCamelCase___() string {
|
|
if m != nil && m.CamelCase___ != nil {
|
|
return *m.CamelCase___
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetGetName() string {
|
|
if m != nil && m.GetName != nil {
|
|
return *m.GetName
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetName_() string {
|
|
if m != nil && m.Name_ != nil {
|
|
return *m.Name_
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type isMessage_OneofConflictA_ interface {
|
|
isMessage_OneofConflictA_()
|
|
}
|
|
|
|
type Message_OneofConflictA struct {
|
|
OneofConflictA string `protobuf:"bytes,40,opt,name=OneofConflictA,oneof"`
|
|
}
|
|
|
|
func (*Message_OneofConflictA) isMessage_OneofConflictA_() {}
|
|
|
|
func (m *Message) GetOneofConflictA_() isMessage_OneofConflictA_ {
|
|
if m != nil {
|
|
return m.OneofConflictA_
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Message) GetOneofConflictA() string {
|
|
if x, ok := m.GetOneofConflictA_().(*Message_OneofConflictA); ok {
|
|
return x.OneofConflictA
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type isMessage_OneofConflictB interface {
|
|
isMessage_OneofConflictB()
|
|
}
|
|
|
|
type Message_OneofNoConflict struct {
|
|
OneofNoConflict string `protobuf:"bytes,50,opt,name=oneof_no_conflict,json=oneofNoConflict,oneof"`
|
|
}
|
|
|
|
type Message_OneofConflictB_ struct {
|
|
OneofConflictB_ string `protobuf:"bytes,51,opt,name=OneofConflictB,oneof"`
|
|
}
|
|
|
|
func (*Message_OneofNoConflict) isMessage_OneofConflictB() {}
|
|
|
|
func (*Message_OneofConflictB_) isMessage_OneofConflictB() {}
|
|
|
|
func (m *Message) GetOneofConflictB() isMessage_OneofConflictB {
|
|
if m != nil {
|
|
return m.OneofConflictB
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Message) GetOneofNoConflict() string {
|
|
if x, ok := m.GetOneofConflictB().(*Message_OneofNoConflict); ok {
|
|
return x.OneofNoConflict
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Message) GetOneofConflictB_() string {
|
|
if x, ok := m.GetOneofConflictB().(*Message_OneofConflictB_); ok {
|
|
return x.OneofConflictB_
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type isMessage_OneofConflictC interface {
|
|
isMessage_OneofConflictC()
|
|
}
|
|
|
|
type Message_OneofMessageConflict_ struct {
|
|
OneofMessageConflict string `protobuf:"bytes,60,opt,name=oneof_message_conflict,json=oneofMessageConflict,oneof"`
|
|
}
|
|
|
|
func (*Message_OneofMessageConflict_) isMessage_OneofConflictC() {}
|
|
|
|
func (m *Message) GetOneofConflictC() isMessage_OneofConflictC {
|
|
if m != nil {
|
|
return m.OneofConflictC
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Message) GetOneofMessageConflict() string {
|
|
if x, ok := m.GetOneofConflictC().(*Message_OneofMessageConflict_); ok {
|
|
return x.OneofMessageConflict
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// XXX_OneofWrappers is for the internal use of the proto package.
|
|
func (*Message) XXX_OneofWrappers() []interface{} {
|
|
return []interface{}{
|
|
(*Message_OneofConflictA)(nil),
|
|
(*Message_OneofNoConflict)(nil),
|
|
(*Message_OneofConflictB_)(nil),
|
|
(*Message_OneofMessageConflict_)(nil),
|
|
}
|
|
}
|
|
|
|
type Message_OneofMessageConflict struct {
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
type xxx_Message_OneofMessageConflict struct{ m *Message_OneofMessageConflict }
|
|
|
|
func (m *Message_OneofMessageConflict) ProtoReflect() protoreflect.Message {
|
|
return xxx_Message_OneofMessageConflict{m}
|
|
}
|
|
func (m xxx_Message_OneofMessageConflict) Type() protoreflect.MessageType {
|
|
return xxx_Fieldnames_ProtoFile_MessageTypes[1].Type
|
|
}
|
|
func (m xxx_Message_OneofMessageConflict) KnownFields() protoreflect.KnownFields {
|
|
return xxx_Fieldnames_ProtoFile_MessageTypes[1].KnownFieldsOf(m.m)
|
|
}
|
|
func (m xxx_Message_OneofMessageConflict) UnknownFields() protoreflect.UnknownFields {
|
|
return xxx_Fieldnames_ProtoFile_MessageTypes[1].UnknownFieldsOf(m.m)
|
|
}
|
|
func (m xxx_Message_OneofMessageConflict) Interface() protoreflect.ProtoMessage {
|
|
return m.m
|
|
}
|
|
func (m xxx_Message_OneofMessageConflict) ProtoMutable() {}
|
|
|
|
func (m *Message_OneofMessageConflict) Reset() { *m = Message_OneofMessageConflict{} }
|
|
func (m *Message_OneofMessageConflict) String() string { return proto.CompactTextString(m) }
|
|
func (*Message_OneofMessageConflict) ProtoMessage() {}
|
|
func (*Message_OneofMessageConflict) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_6bbe3f70febb9403, []int{0, 0}
|
|
}
|
|
|
|
func (m *Message_OneofMessageConflict) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Message_OneofMessageConflict.Unmarshal(m, b)
|
|
}
|
|
func (m *Message_OneofMessageConflict) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Message_OneofMessageConflict.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Message_OneofMessageConflict) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Message_OneofMessageConflict.Merge(m, src)
|
|
}
|
|
func (m *Message_OneofMessageConflict) XXX_Size() int {
|
|
return xxx_messageInfo_Message_OneofMessageConflict.Size(m)
|
|
}
|
|
func (m *Message_OneofMessageConflict) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Message_OneofMessageConflict.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Message_OneofMessageConflict proto.InternalMessageInfo
|
|
|
|
func init() {
|
|
proto.RegisterType((*Message)(nil), "goproto.protoc.fieldnames.Message")
|
|
proto.RegisterType((*Message_OneofMessageConflict)(nil), "goproto.protoc.fieldnames.Message.OneofMessageConflict")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("fieldnames/fieldnames.proto", fileDescriptor_6bbe3f70febb9403) }
|
|
|
|
var fileDescriptor_6bbe3f70febb9403 = []byte{
|
|
// 417 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x93, 0x4b, 0x6f, 0xd3, 0x40,
|
|
0x10, 0xc7, 0x49, 0x29, 0x6a, 0x32, 0x69, 0x79, 0xac, 0x42, 0xd8, 0x3e, 0x08, 0x08, 0x2e, 0x39,
|
|
0xd0, 0x58, 0x2a, 0x12, 0x27, 0x2e, 0x24, 0xa2, 0xe2, 0x42, 0x23, 0x45, 0x3d, 0x71, 0x59, 0x6d,
|
|
0x36, 0xe3, 0x8d, 0x25, 0x7b, 0xa7, 0xb2, 0xd7, 0xf0, 0xd5, 0xf8, 0x78, 0xc8, 0xb3, 0x7e, 0x54,
|
|
0xc1, 0xb7, 0x99, 0xdf, 0xff, 0x11, 0x8d, 0x57, 0x81, 0xcb, 0x38, 0xc1, 0x74, 0xe7, 0x74, 0x86,
|
|
0x45, 0xd4, 0x8d, 0x8b, 0x87, 0x9c, 0x3c, 0x89, 0x73, 0x4b, 0x3c, 0x84, 0xd5, 0x2c, 0x3a, 0xc3,
|
|
0x87, 0xbf, 0xcf, 0xe0, 0xe4, 0x27, 0x16, 0x85, 0xb6, 0x28, 0x2e, 0x61, 0xc4, 0x8a, 0x22, 0x87,
|
|
0x72, 0xf0, 0x7e, 0x30, 0x1f, 0x6d, 0x86, 0x0c, 0xd6, 0x0e, 0xc5, 0x05, 0x0c, 0x6f, 0xab, 0xf9,
|
|
0xfe, 0x0f, 0xc9, 0xa3, 0xa0, 0x35, 0xbb, 0x98, 0x01, 0xb0, 0xef, 0x7e, 0x9f, 0x23, 0xca, 0xa7,
|
|
0xac, 0x3e, 0x22, 0x62, 0x06, 0xe3, 0x50, 0xac, 0x62, 0x2a, 0x73, 0x79, 0xcc, 0x86, 0xf0, 0x5b,
|
|
0xb7, 0x54, 0xe6, 0x55, 0x7e, 0x87, 0x85, 0xc9, 0x93, 0x07, 0x4f, 0xb9, 0x84, 0x90, 0xef, 0x88,
|
|
0x90, 0x70, 0x92, 0xe9, 0xbc, 0xd8, 0xeb, 0x54, 0x8e, 0x59, 0x6c, 0x56, 0x71, 0x05, 0xa3, 0xd2,
|
|
0x35, 0xda, 0x69, 0xe8, 0x6d, 0x81, 0xf8, 0x08, 0x67, 0x7c, 0xb1, 0xca, 0xc2, 0x85, 0xf2, 0x8c,
|
|
0x1d, 0xa7, 0x0c, 0x9b, 0xab, 0xaf, 0x60, 0xb4, 0xd2, 0x19, 0xa6, 0x2b, 0x5d, 0xa0, 0x9c, 0x84,
|
|
0x8a, 0x16, 0x88, 0xb7, 0x00, 0xed, 0xa2, 0xe4, 0xeb, 0x1e, 0xd9, 0x54, 0x8b, 0x32, 0x55, 0x7a,
|
|
0x1a, 0x64, 0xd3, 0xca, 0x33, 0x18, 0x77, 0x69, 0x25, 0xdf, 0x1c, 0xc6, 0xcf, 0x61, 0x68, 0xd1,
|
|
0xab, 0xea, 0x29, 0xe4, 0x2c, 0x5c, 0x66, 0xd1, 0xdf, 0xe9, 0x0c, 0x85, 0x80, 0x63, 0xc6, 0xef,
|
|
0x18, 0xf3, 0x2c, 0xe6, 0xf0, 0x7c, 0xed, 0x90, 0xe2, 0x15, 0xb9, 0x38, 0x4d, 0x8c, 0xff, 0x26,
|
|
0xe7, 0x95, 0xfa, 0xe3, 0xc9, 0xe6, 0x80, 0x8b, 0x4f, 0xf0, 0x8a, 0x2a, 0xa2, 0x1c, 0x29, 0x53,
|
|
0x53, 0x79, 0xc3, 0xe6, 0xc1, 0xe6, 0x05, 0x4b, 0x77, 0xd4, 0xd8, 0xff, 0xeb, 0x5d, 0xca, 0xcf,
|
|
0xb5, 0xf5, 0x80, 0x8b, 0x2f, 0x30, 0x0d, 0xbd, 0xf5, 0x17, 0xed, 0xca, 0xbf, 0x72, 0xe2, 0x68,
|
|
0x33, 0x61, 0xbd, 0xfe, 0xb8, 0x4d, 0xf0, 0x62, 0x0a, 0x93, 0x75, 0x0f, 0x5f, 0x0a, 0x78, 0x19,
|
|
0xfa, 0x9a, 0x1e, 0xa5, 0x7b, 0xd8, 0xb6, 0x87, 0x99, 0xe5, 0xf7, 0x5f, 0x2b, 0x9b, 0xf8, 0x7d,
|
|
0xb9, 0x5d, 0x18, 0xca, 0x22, 0x4b, 0xa9, 0x76, 0x36, 0xe2, 0xa7, 0xdd, 0x96, 0x71, 0xf4, 0xfb,
|
|
0x26, 0x32, 0xd9, 0x2e, 0xec, 0xe6, 0xda, 0xa2, 0xbb, 0xb6, 0x14, 0x79, 0x2c, 0xfc, 0x4e, 0x7b,
|
|
0xfd, 0xe8, 0x2f, 0xf2, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xbd, 0xee, 0x38, 0xe6, 0x3a, 0x03, 0x00,
|
|
0x00,
|
|
}
|
|
|
|
func init() {
|
|
xxx_Fieldnames_ProtoFile_FileDesc.Messages = xxx_Fieldnames_ProtoFile_MessageDescs[0:1]
|
|
xxx_Fieldnames_ProtoFile_MessageDescs[0].Messages = xxx_Fieldnames_ProtoFile_MessageDescs[1:2]
|
|
var err error
|
|
Fieldnames_ProtoFile, err = prototype.NewFile(&xxx_Fieldnames_ProtoFile_FileDesc)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
const _ = protoimpl.EnforceVersion(protoimpl.Version - 0)
|
|
|
|
var Fieldnames_ProtoFile protoreflect.FileDescriptor
|
|
|
|
var xxx_Fieldnames_ProtoFile_FileDesc = prototype.File{
|
|
Syntax: protoreflect.Proto2,
|
|
Path: "fieldnames/fieldnames.proto",
|
|
Package: "goproto.protoc.fieldnames",
|
|
}
|
|
var xxx_Fieldnames_ProtoFile_MessageTypes = [2]protoimpl.MessageType{
|
|
{Type: prototype.GoMessage(
|
|
xxx_Fieldnames_ProtoFile_MessageDescs[0].Reference(),
|
|
func(protoreflect.MessageType) protoreflect.ProtoMessage {
|
|
return new(Message)
|
|
},
|
|
)},
|
|
{Type: prototype.GoMessage(
|
|
xxx_Fieldnames_ProtoFile_MessageDescs[1].Reference(),
|
|
func(protoreflect.MessageType) protoreflect.ProtoMessage {
|
|
return new(Message_OneofMessageConflict)
|
|
},
|
|
)},
|
|
}
|
|
var xxx_Fieldnames_ProtoFile_MessageDescs = [2]prototype.Message{
|
|
{
|
|
Name: "Message",
|
|
Fields: []prototype.Field{
|
|
{
|
|
Name: "field_one",
|
|
Number: 1,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "fieldOne",
|
|
},
|
|
{
|
|
Name: "FieldTwo",
|
|
Number: 2,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "FieldTwo",
|
|
},
|
|
{
|
|
Name: "fieldThree",
|
|
Number: 3,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "fieldThree",
|
|
},
|
|
{
|
|
Name: "field__four",
|
|
Number: 4,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "fieldFour",
|
|
},
|
|
{
|
|
Name: "descriptor",
|
|
Number: 10,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "descriptor",
|
|
},
|
|
{
|
|
Name: "marshal",
|
|
Number: 11,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "marshal",
|
|
},
|
|
{
|
|
Name: "unmarshal",
|
|
Number: 12,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "unmarshal",
|
|
},
|
|
{
|
|
Name: "proto_message",
|
|
Number: 13,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "protoMessage",
|
|
},
|
|
{
|
|
Name: "CamelCase",
|
|
Number: 20,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "CamelCase",
|
|
},
|
|
{
|
|
Name: "CamelCase_",
|
|
Number: 21,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "CamelCase",
|
|
},
|
|
{
|
|
Name: "camel_case",
|
|
Number: 22,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "camelCase",
|
|
},
|
|
{
|
|
Name: "CamelCase__",
|
|
Number: 23,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "CamelCase",
|
|
},
|
|
{
|
|
Name: "get_name",
|
|
Number: 30,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "getName",
|
|
},
|
|
{
|
|
Name: "name",
|
|
Number: 31,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "name",
|
|
},
|
|
{
|
|
Name: "OneofConflictA",
|
|
Number: 40,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "OneofConflictA",
|
|
OneofName: "oneof_conflict_a",
|
|
},
|
|
{
|
|
Name: "oneof_no_conflict",
|
|
Number: 50,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "oneofNoConflict",
|
|
OneofName: "oneof_conflict_b",
|
|
},
|
|
{
|
|
Name: "OneofConflictB",
|
|
Number: 51,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "OneofConflictB",
|
|
OneofName: "oneof_conflict_b",
|
|
},
|
|
{
|
|
Name: "oneof_message_conflict",
|
|
Number: 60,
|
|
Cardinality: protoreflect.Optional,
|
|
Kind: protoreflect.StringKind,
|
|
JSONName: "oneofMessageConflict",
|
|
OneofName: "oneof_conflict_c",
|
|
},
|
|
},
|
|
Oneofs: []prototype.Oneof{
|
|
{Name: "oneof_conflict_a"},
|
|
{Name: "oneof_conflict_b"},
|
|
{Name: "oneof_conflict_c"},
|
|
},
|
|
},
|
|
{
|
|
Name: "OneofMessageConflict",
|
|
},
|
|
}
|