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