mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-04 02:38:50 +00:00
154da98aa5
Add special-case handling for extension fields named "message_set_extension" that extend a message_set_wire_format message. Support special cases for a proto1 feature that was superseded by proto2 extensions. Change-Id: Icbdb711111c66be547bf8d6f37ab3079c320e2a1 Reviewed-on: https://go-review.googlesource.com/136536 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
356 lines
13 KiB
Go
356 lines
13 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: proto2/enum.proto
|
|
|
|
package proto2
|
|
|
|
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.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
// EnumType1 comment.
|
|
type EnumType1 int32
|
|
|
|
const (
|
|
// EnumType1_ONE comment.
|
|
EnumType1_ONE EnumType1 = 1
|
|
// EnumType1_TWO comment.
|
|
EnumType1_TWO EnumType1 = 2
|
|
)
|
|
|
|
var EnumType1_name = map[int32]string{
|
|
1: "ONE",
|
|
2: "TWO",
|
|
}
|
|
|
|
var EnumType1_value = map[string]int32{
|
|
"ONE": 1,
|
|
"TWO": 2,
|
|
}
|
|
|
|
func (x EnumType1) Enum() *EnumType1 {
|
|
p := new(EnumType1)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x EnumType1) String() string {
|
|
return proto.EnumName(EnumType1_name, int32(x))
|
|
}
|
|
|
|
func (x *EnumType1) UnmarshalJSON(data []byte) error {
|
|
value, err := proto.UnmarshalJSONEnum(EnumType1_value, data, "EnumType1")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*x = EnumType1(value)
|
|
return nil
|
|
}
|
|
|
|
func (EnumType1) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_de9f68860d540858, []int{0}
|
|
}
|
|
|
|
type EnumType2 int32
|
|
|
|
const (
|
|
EnumType2_duplicate1 EnumType2 = 1
|
|
EnumType2_duplicate2 EnumType2 = 1
|
|
)
|
|
|
|
var EnumType2_name = map[int32]string{
|
|
1: "duplicate1",
|
|
// Duplicate value: 1: "duplicate2",
|
|
}
|
|
|
|
var EnumType2_value = map[string]int32{
|
|
"duplicate1": 1,
|
|
"duplicate2": 1,
|
|
}
|
|
|
|
func (x EnumType2) Enum() *EnumType2 {
|
|
p := new(EnumType2)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x EnumType2) String() string {
|
|
return proto.EnumName(EnumType2_name, int32(x))
|
|
}
|
|
|
|
func (x *EnumType2) UnmarshalJSON(data []byte) error {
|
|
value, err := proto.UnmarshalJSONEnum(EnumType2_value, data, "EnumType2")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*x = EnumType2(value)
|
|
return nil
|
|
}
|
|
|
|
func (EnumType2) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_de9f68860d540858, []int{1}
|
|
}
|
|
|
|
// NestedEnumType1A comment.
|
|
type EnumContainerMessage1_NestedEnumType1A int32
|
|
|
|
const (
|
|
// NestedEnumType1A_VALUE comment.
|
|
EnumContainerMessage1_NESTED_1A_VALUE EnumContainerMessage1_NestedEnumType1A = 0
|
|
)
|
|
|
|
var EnumContainerMessage1_NestedEnumType1A_name = map[int32]string{
|
|
0: "NESTED_1A_VALUE",
|
|
}
|
|
|
|
var EnumContainerMessage1_NestedEnumType1A_value = map[string]int32{
|
|
"NESTED_1A_VALUE": 0,
|
|
}
|
|
|
|
func (x EnumContainerMessage1_NestedEnumType1A) Enum() *EnumContainerMessage1_NestedEnumType1A {
|
|
p := new(EnumContainerMessage1_NestedEnumType1A)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x EnumContainerMessage1_NestedEnumType1A) String() string {
|
|
return proto.EnumName(EnumContainerMessage1_NestedEnumType1A_name, int32(x))
|
|
}
|
|
|
|
func (x *EnumContainerMessage1_NestedEnumType1A) UnmarshalJSON(data []byte) error {
|
|
value, err := proto.UnmarshalJSONEnum(EnumContainerMessage1_NestedEnumType1A_value, data, "EnumContainerMessage1_NestedEnumType1A")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*x = EnumContainerMessage1_NestedEnumType1A(value)
|
|
return nil
|
|
}
|
|
|
|
func (EnumContainerMessage1_NestedEnumType1A) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_de9f68860d540858, []int{0, 0}
|
|
}
|
|
|
|
type EnumContainerMessage1_NestedEnumType1B int32
|
|
|
|
const (
|
|
EnumContainerMessage1_NESTED_1B_VALUE EnumContainerMessage1_NestedEnumType1B = 0
|
|
)
|
|
|
|
var EnumContainerMessage1_NestedEnumType1B_name = map[int32]string{
|
|
0: "NESTED_1B_VALUE",
|
|
}
|
|
|
|
var EnumContainerMessage1_NestedEnumType1B_value = map[string]int32{
|
|
"NESTED_1B_VALUE": 0,
|
|
}
|
|
|
|
func (x EnumContainerMessage1_NestedEnumType1B) Enum() *EnumContainerMessage1_NestedEnumType1B {
|
|
p := new(EnumContainerMessage1_NestedEnumType1B)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x EnumContainerMessage1_NestedEnumType1B) String() string {
|
|
return proto.EnumName(EnumContainerMessage1_NestedEnumType1B_name, int32(x))
|
|
}
|
|
|
|
func (x *EnumContainerMessage1_NestedEnumType1B) UnmarshalJSON(data []byte) error {
|
|
value, err := proto.UnmarshalJSONEnum(EnumContainerMessage1_NestedEnumType1B_value, data, "EnumContainerMessage1_NestedEnumType1B")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*x = EnumContainerMessage1_NestedEnumType1B(value)
|
|
return nil
|
|
}
|
|
|
|
func (EnumContainerMessage1_NestedEnumType1B) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_de9f68860d540858, []int{0, 1}
|
|
}
|
|
|
|
// NestedEnumType2A comment.
|
|
type EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A int32
|
|
|
|
const (
|
|
// NestedEnumType2A_VALUE comment.
|
|
EnumContainerMessage1_EnumContainerMessage2_NESTED_2A_VALUE EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A = 0
|
|
)
|
|
|
|
var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_name = map[int32]string{
|
|
0: "NESTED_2A_VALUE",
|
|
}
|
|
|
|
var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_value = map[string]int32{
|
|
"NESTED_2A_VALUE": 0,
|
|
}
|
|
|
|
func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) Enum() *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A {
|
|
p := new(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) String() string {
|
|
return proto.EnumName(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_name, int32(x))
|
|
}
|
|
|
|
func (x *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) UnmarshalJSON(data []byte) error {
|
|
value, err := proto.UnmarshalJSONEnum(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_value, data, "EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*x = EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A(value)
|
|
return nil
|
|
}
|
|
|
|
func (EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_de9f68860d540858, []int{0, 0, 0}
|
|
}
|
|
|
|
type EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B int32
|
|
|
|
const (
|
|
EnumContainerMessage1_EnumContainerMessage2_NESTED_2B_VALUE EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B = 0
|
|
)
|
|
|
|
var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_name = map[int32]string{
|
|
0: "NESTED_2B_VALUE",
|
|
}
|
|
|
|
var EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_value = map[string]int32{
|
|
"NESTED_2B_VALUE": 0,
|
|
}
|
|
|
|
func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) Enum() *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B {
|
|
p := new(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B)
|
|
*p = x
|
|
return p
|
|
}
|
|
|
|
func (x EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) String() string {
|
|
return proto.EnumName(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_name, int32(x))
|
|
}
|
|
|
|
func (x *EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) UnmarshalJSON(data []byte) error {
|
|
value, err := proto.UnmarshalJSONEnum(EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_value, data, "EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*x = EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B(value)
|
|
return nil
|
|
}
|
|
|
|
func (EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_de9f68860d540858, []int{0, 0, 1}
|
|
}
|
|
|
|
type EnumContainerMessage1 struct {
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *EnumContainerMessage1) Reset() { *m = EnumContainerMessage1{} }
|
|
func (m *EnumContainerMessage1) String() string { return proto.CompactTextString(m) }
|
|
func (*EnumContainerMessage1) ProtoMessage() {}
|
|
func (*EnumContainerMessage1) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_de9f68860d540858, []int{0}
|
|
}
|
|
|
|
func (m *EnumContainerMessage1) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_EnumContainerMessage1.Unmarshal(m, b)
|
|
}
|
|
func (m *EnumContainerMessage1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_EnumContainerMessage1.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *EnumContainerMessage1) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_EnumContainerMessage1.Merge(m, src)
|
|
}
|
|
func (m *EnumContainerMessage1) XXX_Size() int {
|
|
return xxx_messageInfo_EnumContainerMessage1.Size(m)
|
|
}
|
|
func (m *EnumContainerMessage1) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_EnumContainerMessage1.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_EnumContainerMessage1 proto.InternalMessageInfo
|
|
|
|
type EnumContainerMessage1_EnumContainerMessage2 struct {
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *EnumContainerMessage1_EnumContainerMessage2) Reset() {
|
|
*m = EnumContainerMessage1_EnumContainerMessage2{}
|
|
}
|
|
func (m *EnumContainerMessage1_EnumContainerMessage2) String() string {
|
|
return proto.CompactTextString(m)
|
|
}
|
|
func (*EnumContainerMessage1_EnumContainerMessage2) ProtoMessage() {}
|
|
func (*EnumContainerMessage1_EnumContainerMessage2) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_de9f68860d540858, []int{0, 0}
|
|
}
|
|
|
|
func (m *EnumContainerMessage1_EnumContainerMessage2) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_EnumContainerMessage1_EnumContainerMessage2.Unmarshal(m, b)
|
|
}
|
|
func (m *EnumContainerMessage1_EnumContainerMessage2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_EnumContainerMessage1_EnumContainerMessage2.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *EnumContainerMessage1_EnumContainerMessage2) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_EnumContainerMessage1_EnumContainerMessage2.Merge(m, src)
|
|
}
|
|
func (m *EnumContainerMessage1_EnumContainerMessage2) XXX_Size() int {
|
|
return xxx_messageInfo_EnumContainerMessage1_EnumContainerMessage2.Size(m)
|
|
}
|
|
func (m *EnumContainerMessage1_EnumContainerMessage2) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_EnumContainerMessage1_EnumContainerMessage2.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_EnumContainerMessage1_EnumContainerMessage2 proto.InternalMessageInfo
|
|
|
|
func init() {
|
|
proto.RegisterEnum("goproto.protoc.proto2.EnumType1", EnumType1_name, EnumType1_value)
|
|
proto.RegisterEnum("goproto.protoc.proto2.EnumType2", EnumType2_name, EnumType2_value)
|
|
proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_NestedEnumType1A", EnumContainerMessage1_NestedEnumType1A_name, EnumContainerMessage1_NestedEnumType1A_value)
|
|
proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_NestedEnumType1B", EnumContainerMessage1_NestedEnumType1B_name, EnumContainerMessage1_NestedEnumType1B_value)
|
|
proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A", EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_name, EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2A_value)
|
|
proto.RegisterEnum("goproto.protoc.proto2.EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B", EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_name, EnumContainerMessage1_EnumContainerMessage2_NestedEnumType2B_value)
|
|
proto.RegisterType((*EnumContainerMessage1)(nil), "goproto.protoc.proto2.EnumContainerMessage1")
|
|
proto.RegisterType((*EnumContainerMessage1_EnumContainerMessage2)(nil), "goproto.protoc.proto2.EnumContainerMessage1.EnumContainerMessage2")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("proto2/enum.proto", fileDescriptor_de9f68860d540858) }
|
|
|
|
var fileDescriptor_de9f68860d540858 = []byte{
|
|
// 248 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x41, 0x4b, 0xc3, 0x30,
|
|
0x18, 0x86, 0xcd, 0x3c, 0x88, 0x39, 0x68, 0xac, 0xec, 0x32, 0xf0, 0xb2, 0x8b, 0x30, 0xd8, 0x42,
|
|
0xbe, 0x3f, 0x20, 0xad, 0xe6, 0xa6, 0xdd, 0xc1, 0xaa, 0xe0, 0x65, 0x64, 0xe9, 0x67, 0x2c, 0xac,
|
|
0x49, 0x59, 0xbf, 0x08, 0xfe, 0x4f, 0x7f, 0x90, 0xac, 0x85, 0x59, 0x61, 0x7a, 0xca, 0xfb, 0xe6,
|
|
0x7d, 0x78, 0x0e, 0x1f, 0xbf, 0x68, 0xb6, 0x81, 0x02, 0x48, 0xf4, 0xb1, 0x5e, 0x74, 0x39, 0x19,
|
|
0xbb, 0xd0, 0x85, 0xbe, 0xda, 0xfe, 0x81, 0xe9, 0x17, 0xe3, 0x63, 0xed, 0x63, 0x7d, 0x1b, 0x3c,
|
|
0x99, 0xca, 0xe3, 0xf6, 0x01, 0xdb, 0xd6, 0x38, 0x54, 0x93, 0xea, 0xf0, 0x00, 0xd3, 0x6b, 0x2e,
|
|
0x72, 0x6c, 0x09, 0xcb, 0xdd, 0x5c, 0x7c, 0x36, 0x08, 0x69, 0x72, 0xc9, 0xcf, 0x73, 0xfd, 0x58,
|
|
0xe8, 0xbb, 0x15, 0xa4, 0xab, 0xe7, 0xf4, 0xfe, 0x49, 0x8b, 0xa3, 0x03, 0x60, 0x36, 0x04, 0xb3,
|
|
0xbf, 0x41, 0x35, 0x34, 0xaa, 0x7f, 0x8c, 0x6a, 0x68, 0x54, 0x7b, 0xe3, 0xec, 0x8a, 0x9f, 0xee,
|
|
0x91, 0xe4, 0x84, 0x1f, 0x2f, 0x73, 0x2d, 0xd8, 0x2e, 0x14, 0x2f, 0x4b, 0x31, 0x9a, 0xc9, 0x9f,
|
|
0x19, 0x92, 0x33, 0xce, 0xcb, 0xd8, 0x6c, 0x2a, 0x6b, 0x08, 0x95, 0x60, 0xbf, 0x3a, 0x08, 0x36,
|
|
0x19, 0x09, 0x96, 0xa5, 0xaf, 0x37, 0xae, 0xa2, 0xf7, 0xb8, 0x5e, 0xd8, 0x50, 0x4b, 0x17, 0x36,
|
|
0xc6, 0x3b, 0xd9, 0x9d, 0x70, 0x1d, 0xdf, 0xe4, 0x07, 0x48, 0x5b, 0x97, 0x7d, 0xb7, 0x73, 0x87,
|
|
0x7e, 0xee, 0x82, 0x24, 0x6c, 0xa9, 0x34, 0x64, 0xfa, 0x6f, 0xf8, 0x0e, 0x00, 0x00, 0xff, 0xff,
|
|
0x5b, 0x88, 0x8a, 0x80, 0x94, 0x01, 0x00, 0x00,
|
|
}
|