Skip to content
Myr

test.pb.go

This file

Path

testdata/protoexample/test.pb.go

298 lines · 8.2 KiB · Go

Last changed by

Not known.

History of this file

Take it

1// Code generated by protoc-gen-go. DO NOT EDIT.2// versions:3// 	protoc-gen-go v1.27.04// 	protoc        v3.15.85// source: test.proto67package protoexample89import (10	protoreflect "google.golang.org/protobuf/reflect/protoreflect"11	protoimpl "google.golang.org/protobuf/runtime/protoimpl"12	reflect "reflect"13	sync "sync"14)1516const (17	// Verify that this generated code is sufficiently up-to-date.18	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)19	// Verify that runtime/protoimpl is sufficiently up-to-date.20	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)21)2223type FOO int322425const (26	FOO_X FOO = 1727)2829// Enum value maps for FOO.30var (31	FOO_name = map[int32]string{32		17: "X",33	}34	FOO_value = map[string]int32{35		"X": 17,36	}37)3839func (x FOO) Enum() *FOO {40	p := new(FOO)41	*p = x42	return p43}4445func (x FOO) String() string {46	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))47}4849func (FOO) Descriptor() protoreflect.EnumDescriptor {50	return file_test_proto_enumTypes[0].Descriptor()51}5253func (FOO) Type() protoreflect.EnumType {54	return &file_test_proto_enumTypes[0]55}5657func (x FOO) Number() protoreflect.EnumNumber {58	return protoreflect.EnumNumber(x)59}6061// Deprecated: Do not use.62func (x *FOO) UnmarshalJSON(b []byte) error {63	num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b)64	if err != nil {65		return err66	}67	*x = FOO(num)68	return nil69}7071// Deprecated: Use FOO.Descriptor instead.72func (FOO) EnumDescriptor() ([]byte, []int) {73	return file_test_proto_rawDescGZIP(), []int{0}74}7576type Test struct {77	state         protoimpl.MessageState78	sizeCache     protoimpl.SizeCache79	unknownFields protoimpl.UnknownFields8081	Label         *string             `protobuf:"bytes,1,req,name=label" json:"label,omitempty"`82	Type          *int32              `protobuf:"varint,2,opt,name=type,def=77" json:"type,omitempty"`83	Reps          []int64             `protobuf:"varint,3,rep,name=reps" json:"reps,omitempty"`84	Optionalgroup *Test_OptionalGroup `protobuf:"group,4,opt,name=OptionalGroup,json=optionalgroup" json:"optionalgroup,omitempty"`85}8687// Default values for Test fields.88const (89	Default_Test_Type = int32(77)90)9192func (x *Test) Reset() {93	*x = Test{}94	if protoimpl.UnsafeEnabled {95		mi := &file_test_proto_msgTypes[0]96		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))97		ms.StoreMessageInfo(mi)98	}99}100101func (x *Test) String() string {102	return protoimpl.X.MessageStringOf(x)103}104105func (*Test) ProtoMessage() {}106107func (x *Test) ProtoReflect() protoreflect.Message {108	mi := &file_test_proto_msgTypes[0]109	if protoimpl.UnsafeEnabled && x != nil {110		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))111		if ms.LoadMessageInfo() == nil {112			ms.StoreMessageInfo(mi)113		}114		return ms115	}116	return mi.MessageOf(x)117}118119// Deprecated: Use Test.ProtoReflect.Descriptor instead.120func (*Test) Descriptor() ([]byte, []int) {121	return file_test_proto_rawDescGZIP(), []int{0}122}123124func (x *Test) GetLabel() string {125	if x != nil && x.Label != nil {126		return *x.Label127	}128	return ""129}130131func (x *Test) GetType() int32 {132	if x != nil && x.Type != nil {133		return *x.Type134	}135	return Default_Test_Type136}137138func (x *Test) GetReps() []int64 {139	if x != nil {140		return x.Reps141	}142	return nil143}144145func (x *Test) GetOptionalgroup() *Test_OptionalGroup {146	if x != nil {147		return x.Optionalgroup148	}149	return nil150}151152type Test_OptionalGroup struct {153	state         protoimpl.MessageState154	sizeCache     protoimpl.SizeCache155	unknownFields protoimpl.UnknownFields156157	RequiredField *string `protobuf:"bytes,5,req,name=RequiredField" json:"RequiredField,omitempty"`158}159160func (x *Test_OptionalGroup) Reset() {161	*x = Test_OptionalGroup{}162	if protoimpl.UnsafeEnabled {163		mi := &file_test_proto_msgTypes[1]164		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))165		ms.StoreMessageInfo(mi)166	}167}168169func (x *Test_OptionalGroup) String() string {170	return protoimpl.X.MessageStringOf(x)171}172173func (*Test_OptionalGroup) ProtoMessage() {}174175func (x *Test_OptionalGroup) ProtoReflect() protoreflect.Message {176	mi := &file_test_proto_msgTypes[1]177	if protoimpl.UnsafeEnabled && x != nil {178		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))179		if ms.LoadMessageInfo() == nil {180			ms.StoreMessageInfo(mi)181		}182		return ms183	}184	return mi.MessageOf(x)185}186187// Deprecated: Use Test_OptionalGroup.ProtoReflect.Descriptor instead.188func (*Test_OptionalGroup) Descriptor() ([]byte, []int) {189	return file_test_proto_rawDescGZIP(), []int{0, 0}190}191192func (x *Test_OptionalGroup) GetRequiredField() string {193	if x != nil && x.RequiredField != nil {194		return *x.RequiredField195	}196	return ""197}198199var File_test_proto protoreflect.FileDescriptor200201var file_test_proto_rawDesc = []byte{202	0x0a, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x70, 0x72,203	0x6f, 0x74, 0x6f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0xc7, 0x01, 0x0a, 0x04, 0x54,204	0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x02,205	0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x04, 0x74, 0x79, 0x70,206	0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x3a, 0x02, 0x37, 0x37, 0x52, 0x04, 0x74, 0x79, 0x70,207	0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x65, 0x70, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, 0x52,208	0x04, 0x72, 0x65, 0x70, 0x73, 0x12, 0x46, 0x0a, 0x0d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,209	0x6c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0a, 0x32, 0x20, 0x2e, 0x70,210	0x72, 0x6f, 0x74, 0x6f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x54, 0x65, 0x73, 0x74,211	0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x0d,212	0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x1a, 0x35, 0x0a,213	0x0d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x24,214	0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x18,215	0x05, 0x20, 0x02, 0x28, 0x09, 0x52, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x46,216	0x69, 0x65, 0x6c, 0x64, 0x2a, 0x0c, 0x0a, 0x03, 0x46, 0x4f, 0x4f, 0x12, 0x05, 0x0a, 0x01, 0x58,217	0x10, 0x11,218}219220var (221	file_test_proto_rawDescOnce sync.Once222	file_test_proto_rawDescData = file_test_proto_rawDesc223)224225func file_test_proto_rawDescGZIP() []byte {226	file_test_proto_rawDescOnce.Do(func() {227		file_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_test_proto_rawDescData)228	})229	return file_test_proto_rawDescData230}231232var file_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1)233var file_test_proto_msgTypes = make([]protoimpl.MessageInfo, 2)234var file_test_proto_goTypes = []any{235	(FOO)(0),                   // 0: protoexample.FOO236	(*Test)(nil),               // 1: protoexample.Test237	(*Test_OptionalGroup)(nil), // 2: protoexample.Test.OptionalGroup238}239var file_test_proto_depIdxs = []int32{240	2, // 0: protoexample.Test.optionalgroup:type_name -> protoexample.Test.OptionalGroup241	1, // [1:1] is the sub-list for method output_type242	1, // [1:1] is the sub-list for method input_type243	1, // [1:1] is the sub-list for extension type_name244	1, // [1:1] is the sub-list for extension extendee245	0, // [0:1] is the sub-list for field type_name246}247248func init() { file_test_proto_init() }249func file_test_proto_init() {250	if File_test_proto != nil {251		return252	}253	if !protoimpl.UnsafeEnabled {254		file_test_proto_msgTypes[0].Exporter = func(v any, i int) any {255			switch v := v.(*Test); i {256			case 0:257				return &v.state258			case 1:259				return &v.sizeCache260			case 2:261				return &v.unknownFields262			default:263				return nil264			}265		}266		file_test_proto_msgTypes[1].Exporter = func(v any, i int) any {267			switch v := v.(*Test_OptionalGroup); i {268			case 0:269				return &v.state270			case 1:271				return &v.sizeCache272			case 2:273				return &v.unknownFields274			default:275				return nil276			}277		}278	}279	type x struct{}280	out := protoimpl.TypeBuilder{281		File: protoimpl.DescBuilder{282			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),283			RawDescriptor: file_test_proto_rawDesc,284			NumEnums:      1,285			NumMessages:   2,286			NumExtensions: 0,287			NumServices:   0,288		},289		GoTypes:           file_test_proto_goTypes,290		DependencyIndexes: file_test_proto_depIdxs,291		EnumInfos:         file_test_proto_enumTypes,292		MessageInfos:      file_test_proto_msgTypes,293	}.Build()294	File_test_proto = out.File295	file_test_proto_rawDesc = nil296	file_test_proto_goTypes = nil297	file_test_proto_depIdxs = nil298}