github.com/jhump/protoreflect@v1.16.0/internal/testprotos/proto3_optional/desc_test_proto3_optional.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // versions: 3 // protoc-gen-go v1.33.0-devel 4 // protoc v5.26.1 5 // source: proto3_optional/desc_test_proto3_optional.proto 6 7 package testprotos 8 9 import ( 10 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 11 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 12 descriptorpb "google.golang.org/protobuf/types/descriptorpb" 13 reflect "reflect" 14 sync "sync" 15 ) 16 17 const ( 18 // Verify that this generated code is sufficiently up-to-date. 19 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 20 // Verify that runtime/protoimpl is sufficiently up-to-date. 21 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 22 ) 23 24 type MessageWithOptionalFields struct { 25 state protoimpl.MessageState 26 sizeCache protoimpl.SizeCache 27 unknownFields protoimpl.UnknownFields 28 29 Foo *string `protobuf:"bytes,1,opt,name=foo,proto3,oneof" json:"foo,omitempty"` 30 Bar *int64 `protobuf:"varint,2,opt,name=bar,proto3,oneof" json:"bar,omitempty"` 31 } 32 33 func (x *MessageWithOptionalFields) Reset() { 34 *x = MessageWithOptionalFields{} 35 if protoimpl.UnsafeEnabled { 36 mi := &file_proto3_optional_desc_test_proto3_optional_proto_msgTypes[0] 37 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 38 ms.StoreMessageInfo(mi) 39 } 40 } 41 42 func (x *MessageWithOptionalFields) String() string { 43 return protoimpl.X.MessageStringOf(x) 44 } 45 46 func (*MessageWithOptionalFields) ProtoMessage() {} 47 48 func (x *MessageWithOptionalFields) ProtoReflect() protoreflect.Message { 49 mi := &file_proto3_optional_desc_test_proto3_optional_proto_msgTypes[0] 50 if protoimpl.UnsafeEnabled && x != nil { 51 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 52 if ms.LoadMessageInfo() == nil { 53 ms.StoreMessageInfo(mi) 54 } 55 return ms 56 } 57 return mi.MessageOf(x) 58 } 59 60 // Deprecated: Use MessageWithOptionalFields.ProtoReflect.Descriptor instead. 61 func (*MessageWithOptionalFields) Descriptor() ([]byte, []int) { 62 return file_proto3_optional_desc_test_proto3_optional_proto_rawDescGZIP(), []int{0} 63 } 64 65 func (x *MessageWithOptionalFields) GetFoo() string { 66 if x != nil && x.Foo != nil { 67 return *x.Foo 68 } 69 return "" 70 } 71 72 func (x *MessageWithOptionalFields) GetBar() int64 { 73 if x != nil && x.Bar != nil { 74 return *x.Bar 75 } 76 return 0 77 } 78 79 var file_proto3_optional_desc_test_proto3_optional_proto_extTypes = []protoimpl.ExtensionInfo{ 80 { 81 ExtendedType: (*descriptorpb.MessageOptions)(nil), 82 ExtensionType: (*string)(nil), 83 Field: 44444, 84 Name: "some_custom_options", 85 Tag: "bytes,44444,opt,name=some_custom_options", 86 Filename: "proto3_optional/desc_test_proto3_optional.proto", 87 }, 88 } 89 90 // Extension fields to descriptorpb.MessageOptions. 91 var ( 92 // optional string some_custom_options = 44444; 93 E_SomeCustomOptions = &file_proto3_optional_desc_test_proto3_optional_proto_extTypes[0] 94 ) 95 96 var File_proto3_optional_desc_test_proto3_optional_proto protoreflect.FileDescriptor 97 98 var file_proto3_optional_desc_test_proto3_optional_proto_rawDesc = []byte{ 99 0x0a, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 100 0x6c, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 101 0x6f, 0x33, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 102 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 103 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 104 0x6f, 0x74, 0x6f, 0x22, 0x59, 0x0a, 0x19, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 105 0x74, 0x68, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 106 0x12, 0x15, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 107 0x03, 0x66, 0x6f, 0x6f, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 108 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x03, 0x62, 0x61, 0x72, 0x88, 0x01, 0x01, 0x42, 0x06, 109 0x0a, 0x04, 0x5f, 0x66, 0x6f, 0x6f, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x62, 0x61, 0x72, 0x3a, 0x54, 110 0x0a, 0x13, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 111 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 112 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 113 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9c, 0xdb, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 114 0x73, 0x6f, 0x6d, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 115 0x73, 0x88, 0x01, 0x01, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 116 0x6f, 0x6d, 0x2f, 0x6a, 0x68, 0x75, 0x6d, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 117 0x66, 0x6c, 0x65, 0x63, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 118 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 119 0x33, 120 } 121 122 var ( 123 file_proto3_optional_desc_test_proto3_optional_proto_rawDescOnce sync.Once 124 file_proto3_optional_desc_test_proto3_optional_proto_rawDescData = file_proto3_optional_desc_test_proto3_optional_proto_rawDesc 125 ) 126 127 func file_proto3_optional_desc_test_proto3_optional_proto_rawDescGZIP() []byte { 128 file_proto3_optional_desc_test_proto3_optional_proto_rawDescOnce.Do(func() { 129 file_proto3_optional_desc_test_proto3_optional_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto3_optional_desc_test_proto3_optional_proto_rawDescData) 130 }) 131 return file_proto3_optional_desc_test_proto3_optional_proto_rawDescData 132 } 133 134 var file_proto3_optional_desc_test_proto3_optional_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 135 var file_proto3_optional_desc_test_proto3_optional_proto_goTypes = []interface{}{ 136 (*MessageWithOptionalFields)(nil), // 0: MessageWithOptionalFields 137 (*descriptorpb.MessageOptions)(nil), // 1: google.protobuf.MessageOptions 138 } 139 var file_proto3_optional_desc_test_proto3_optional_proto_depIdxs = []int32{ 140 1, // 0: some_custom_options:extendee -> google.protobuf.MessageOptions 141 1, // [1:1] is the sub-list for method output_type 142 1, // [1:1] is the sub-list for method input_type 143 1, // [1:1] is the sub-list for extension type_name 144 0, // [0:1] is the sub-list for extension extendee 145 0, // [0:0] is the sub-list for field type_name 146 } 147 148 func init() { file_proto3_optional_desc_test_proto3_optional_proto_init() } 149 func file_proto3_optional_desc_test_proto3_optional_proto_init() { 150 if File_proto3_optional_desc_test_proto3_optional_proto != nil { 151 return 152 } 153 if !protoimpl.UnsafeEnabled { 154 file_proto3_optional_desc_test_proto3_optional_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 155 switch v := v.(*MessageWithOptionalFields); i { 156 case 0: 157 return &v.state 158 case 1: 159 return &v.sizeCache 160 case 2: 161 return &v.unknownFields 162 default: 163 return nil 164 } 165 } 166 } 167 file_proto3_optional_desc_test_proto3_optional_proto_msgTypes[0].OneofWrappers = []interface{}{} 168 type x struct{} 169 out := protoimpl.TypeBuilder{ 170 File: protoimpl.DescBuilder{ 171 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 172 RawDescriptor: file_proto3_optional_desc_test_proto3_optional_proto_rawDesc, 173 NumEnums: 0, 174 NumMessages: 1, 175 NumExtensions: 1, 176 NumServices: 0, 177 }, 178 GoTypes: file_proto3_optional_desc_test_proto3_optional_proto_goTypes, 179 DependencyIndexes: file_proto3_optional_desc_test_proto3_optional_proto_depIdxs, 180 MessageInfos: file_proto3_optional_desc_test_proto3_optional_proto_msgTypes, 181 ExtensionInfos: file_proto3_optional_desc_test_proto3_optional_proto_extTypes, 182 }.Build() 183 File_proto3_optional_desc_test_proto3_optional_proto = out.File 184 file_proto3_optional_desc_test_proto3_optional_proto_rawDesc = nil 185 file_proto3_optional_desc_test_proto3_optional_proto_goTypes = nil 186 file_proto3_optional_desc_test_proto3_optional_proto_depIdxs = nil 187 }