github.com/jhump/protoreflect@v1.16.0/internal/testprotos/desc_test_oneof.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: desc_test_oneof.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 reflect "reflect" 13 sync "sync" 14 ) 15 16 const ( 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 ) 22 23 type OneOfMessage struct { 24 state protoimpl.MessageState 25 sizeCache protoimpl.SizeCache 26 unknownFields protoimpl.UnknownFields 27 28 // Types that are assignable to Value: 29 // 30 // *OneOfMessage_BinaryValue 31 // *OneOfMessage_StringValue 32 // *OneOfMessage_BooleanValue 33 // *OneOfMessage_IntValue 34 // *OneOfMessage_Int64Value 35 // *OneOfMessage_DoubleValue 36 // *OneOfMessage_FloatValue 37 // *OneOfMessage_MsgValue 38 Value isOneOfMessage_Value `protobuf_oneof:"value"` 39 } 40 41 func (x *OneOfMessage) Reset() { 42 *x = OneOfMessage{} 43 if protoimpl.UnsafeEnabled { 44 mi := &file_desc_test_oneof_proto_msgTypes[0] 45 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 46 ms.StoreMessageInfo(mi) 47 } 48 } 49 50 func (x *OneOfMessage) String() string { 51 return protoimpl.X.MessageStringOf(x) 52 } 53 54 func (*OneOfMessage) ProtoMessage() {} 55 56 func (x *OneOfMessage) ProtoReflect() protoreflect.Message { 57 mi := &file_desc_test_oneof_proto_msgTypes[0] 58 if protoimpl.UnsafeEnabled && x != nil { 59 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 60 if ms.LoadMessageInfo() == nil { 61 ms.StoreMessageInfo(mi) 62 } 63 return ms 64 } 65 return mi.MessageOf(x) 66 } 67 68 // Deprecated: Use OneOfMessage.ProtoReflect.Descriptor instead. 69 func (*OneOfMessage) Descriptor() ([]byte, []int) { 70 return file_desc_test_oneof_proto_rawDescGZIP(), []int{0} 71 } 72 73 func (m *OneOfMessage) GetValue() isOneOfMessage_Value { 74 if m != nil { 75 return m.Value 76 } 77 return nil 78 } 79 80 func (x *OneOfMessage) GetBinaryValue() []byte { 81 if x, ok := x.GetValue().(*OneOfMessage_BinaryValue); ok { 82 return x.BinaryValue 83 } 84 return nil 85 } 86 87 func (x *OneOfMessage) GetStringValue() string { 88 if x, ok := x.GetValue().(*OneOfMessage_StringValue); ok { 89 return x.StringValue 90 } 91 return "" 92 } 93 94 func (x *OneOfMessage) GetBooleanValue() bool { 95 if x, ok := x.GetValue().(*OneOfMessage_BooleanValue); ok { 96 return x.BooleanValue 97 } 98 return false 99 } 100 101 func (x *OneOfMessage) GetIntValue() int32 { 102 if x, ok := x.GetValue().(*OneOfMessage_IntValue); ok { 103 return x.IntValue 104 } 105 return 0 106 } 107 108 func (x *OneOfMessage) GetInt64Value() int64 { 109 if x, ok := x.GetValue().(*OneOfMessage_Int64Value); ok { 110 return x.Int64Value 111 } 112 return 0 113 } 114 115 func (x *OneOfMessage) GetDoubleValue() float64 { 116 if x, ok := x.GetValue().(*OneOfMessage_DoubleValue); ok { 117 return x.DoubleValue 118 } 119 return 0 120 } 121 122 func (x *OneOfMessage) GetFloatValue() float32 { 123 if x, ok := x.GetValue().(*OneOfMessage_FloatValue); ok { 124 return x.FloatValue 125 } 126 return 0 127 } 128 129 func (x *OneOfMessage) GetMsgValue() *OneOfMessage { 130 if x, ok := x.GetValue().(*OneOfMessage_MsgValue); ok { 131 return x.MsgValue 132 } 133 return nil 134 } 135 136 type isOneOfMessage_Value interface { 137 isOneOfMessage_Value() 138 } 139 140 type OneOfMessage_BinaryValue struct { 141 BinaryValue []byte `protobuf:"bytes,1,opt,name=binary_value,json=binaryValue,proto3,oneof"` 142 } 143 144 type OneOfMessage_StringValue struct { 145 StringValue string `protobuf:"bytes,2,opt,name=string_value,json=stringValue,proto3,oneof"` 146 } 147 148 type OneOfMessage_BooleanValue struct { 149 BooleanValue bool `protobuf:"varint,3,opt,name=boolean_value,json=booleanValue,proto3,oneof"` 150 } 151 152 type OneOfMessage_IntValue struct { 153 IntValue int32 `protobuf:"varint,4,opt,name=int_value,json=intValue,proto3,oneof"` 154 } 155 156 type OneOfMessage_Int64Value struct { 157 Int64Value int64 `protobuf:"varint,5,opt,name=int64_value,json=int64Value,proto3,oneof"` 158 } 159 160 type OneOfMessage_DoubleValue struct { 161 DoubleValue float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue,proto3,oneof"` 162 } 163 164 type OneOfMessage_FloatValue struct { 165 FloatValue float32 `protobuf:"fixed32,7,opt,name=float_value,json=floatValue,proto3,oneof"` 166 } 167 168 type OneOfMessage_MsgValue struct { 169 MsgValue *OneOfMessage `protobuf:"bytes,8,opt,name=msg_value,json=msgValue,proto3,oneof"` 170 } 171 172 func (*OneOfMessage_BinaryValue) isOneOfMessage_Value() {} 173 174 func (*OneOfMessage_StringValue) isOneOfMessage_Value() {} 175 176 func (*OneOfMessage_BooleanValue) isOneOfMessage_Value() {} 177 178 func (*OneOfMessage_IntValue) isOneOfMessage_Value() {} 179 180 func (*OneOfMessage_Int64Value) isOneOfMessage_Value() {} 181 182 func (*OneOfMessage_DoubleValue) isOneOfMessage_Value() {} 183 184 func (*OneOfMessage_FloatValue) isOneOfMessage_Value() {} 185 186 func (*OneOfMessage_MsgValue) isOneOfMessage_Value() {} 187 188 var File_desc_test_oneof_proto protoreflect.FileDescriptor 189 190 var file_desc_test_oneof_proto_rawDesc = []byte{ 191 0x0a, 0x15, 0x64, 0x65, 0x73, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 192 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 193 0x74, 0x6f, 0x73, 0x22, 0xcb, 0x02, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x4d, 0x65, 0x73, 194 0x73, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x76, 195 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0b, 0x62, 0x69, 196 0x6e, 0x61, 0x72, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 197 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 198 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 199 0x0a, 0x0d, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 200 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 201 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 202 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 203 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 204 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 205 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 206 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 207 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0b, 208 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 209 0x02, 0x48, 0x00, 0x52, 0x0a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 210 0x37, 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 211 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 212 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x48, 0x00, 0x52, 0x08, 213 0x6d, 0x73, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 214 0x65, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 215 0x6a, 0x68, 0x75, 0x6d, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 216 0x63, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 217 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 218 } 219 220 var ( 221 file_desc_test_oneof_proto_rawDescOnce sync.Once 222 file_desc_test_oneof_proto_rawDescData = file_desc_test_oneof_proto_rawDesc 223 ) 224 225 func file_desc_test_oneof_proto_rawDescGZIP() []byte { 226 file_desc_test_oneof_proto_rawDescOnce.Do(func() { 227 file_desc_test_oneof_proto_rawDescData = protoimpl.X.CompressGZIP(file_desc_test_oneof_proto_rawDescData) 228 }) 229 return file_desc_test_oneof_proto_rawDescData 230 } 231 232 var file_desc_test_oneof_proto_msgTypes = make([]protoimpl.MessageInfo, 1) 233 var file_desc_test_oneof_proto_goTypes = []interface{}{ 234 (*OneOfMessage)(nil), // 0: testprotos.OneOfMessage 235 } 236 var file_desc_test_oneof_proto_depIdxs = []int32{ 237 0, // 0: testprotos.OneOfMessage.msg_value:type_name -> testprotos.OneOfMessage 238 1, // [1:1] is the sub-list for method output_type 239 1, // [1:1] is the sub-list for method input_type 240 1, // [1:1] is the sub-list for extension type_name 241 1, // [1:1] is the sub-list for extension extendee 242 0, // [0:1] is the sub-list for field type_name 243 } 244 245 func init() { file_desc_test_oneof_proto_init() } 246 func file_desc_test_oneof_proto_init() { 247 if File_desc_test_oneof_proto != nil { 248 return 249 } 250 if !protoimpl.UnsafeEnabled { 251 file_desc_test_oneof_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 252 switch v := v.(*OneOfMessage); i { 253 case 0: 254 return &v.state 255 case 1: 256 return &v.sizeCache 257 case 2: 258 return &v.unknownFields 259 default: 260 return nil 261 } 262 } 263 } 264 file_desc_test_oneof_proto_msgTypes[0].OneofWrappers = []interface{}{ 265 (*OneOfMessage_BinaryValue)(nil), 266 (*OneOfMessage_StringValue)(nil), 267 (*OneOfMessage_BooleanValue)(nil), 268 (*OneOfMessage_IntValue)(nil), 269 (*OneOfMessage_Int64Value)(nil), 270 (*OneOfMessage_DoubleValue)(nil), 271 (*OneOfMessage_FloatValue)(nil), 272 (*OneOfMessage_MsgValue)(nil), 273 } 274 type x struct{} 275 out := protoimpl.TypeBuilder{ 276 File: protoimpl.DescBuilder{ 277 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 278 RawDescriptor: file_desc_test_oneof_proto_rawDesc, 279 NumEnums: 0, 280 NumMessages: 1, 281 NumExtensions: 0, 282 NumServices: 0, 283 }, 284 GoTypes: file_desc_test_oneof_proto_goTypes, 285 DependencyIndexes: file_desc_test_oneof_proto_depIdxs, 286 MessageInfos: file_desc_test_oneof_proto_msgTypes, 287 }.Build() 288 File_desc_test_oneof_proto = out.File 289 file_desc_test_oneof_proto_rawDesc = nil 290 file_desc_test_oneof_proto_goTypes = nil 291 file_desc_test_oneof_proto_depIdxs = nil 292 }