github.com/grafana/pyroscope@v1.18.0/pkg/frontend/frontendpb/frontend_vtproto.pb.go (about) 1 // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. 2 // protoc-gen-go-vtproto version: v0.6.0 3 // source: frontend/frontendpb/frontend.proto 4 5 package frontendpb 6 7 import ( 8 context "context" 9 fmt "fmt" 10 stats "github.com/grafana/pyroscope/pkg/querier/stats" 11 httpgrpc "github.com/grafana/pyroscope/pkg/util/httpgrpc" 12 protohelpers "github.com/planetscale/vtprotobuf/protohelpers" 13 grpc "google.golang.org/grpc" 14 codes "google.golang.org/grpc/codes" 15 status "google.golang.org/grpc/status" 16 proto "google.golang.org/protobuf/proto" 17 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 18 io "io" 19 ) 20 21 const ( 22 // Verify that this generated code is sufficiently up-to-date. 23 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 24 // Verify that runtime/protoimpl is sufficiently up-to-date. 25 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 26 ) 27 28 // This is a compile-time assertion to ensure that this generated file 29 // is compatible with the grpc package it is being compiled against. 30 // Requires gRPC-Go v1.32.0 or later. 31 const _ = grpc.SupportPackageIsVersion7 32 33 // FrontendForQuerierClient is the client API for FrontendForQuerier service. 34 // 35 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. 36 type FrontendForQuerierClient interface { 37 QueryResult(ctx context.Context, in *QueryResultRequest, opts ...grpc.CallOption) (*QueryResultResponse, error) 38 } 39 40 type frontendForQuerierClient struct { 41 cc grpc.ClientConnInterface 42 } 43 44 func NewFrontendForQuerierClient(cc grpc.ClientConnInterface) FrontendForQuerierClient { 45 return &frontendForQuerierClient{cc} 46 } 47 48 func (c *frontendForQuerierClient) QueryResult(ctx context.Context, in *QueryResultRequest, opts ...grpc.CallOption) (*QueryResultResponse, error) { 49 out := new(QueryResultResponse) 50 err := c.cc.Invoke(ctx, "/frontendpb.FrontendForQuerier/QueryResult", in, out, opts...) 51 if err != nil { 52 return nil, err 53 } 54 return out, nil 55 } 56 57 // FrontendForQuerierServer is the server API for FrontendForQuerier service. 58 // All implementations must embed UnimplementedFrontendForQuerierServer 59 // for forward compatibility 60 type FrontendForQuerierServer interface { 61 QueryResult(context.Context, *QueryResultRequest) (*QueryResultResponse, error) 62 mustEmbedUnimplementedFrontendForQuerierServer() 63 } 64 65 // UnimplementedFrontendForQuerierServer must be embedded to have forward compatible implementations. 66 type UnimplementedFrontendForQuerierServer struct { 67 } 68 69 func (UnimplementedFrontendForQuerierServer) QueryResult(context.Context, *QueryResultRequest) (*QueryResultResponse, error) { 70 return nil, status.Errorf(codes.Unimplemented, "method QueryResult not implemented") 71 } 72 func (UnimplementedFrontendForQuerierServer) mustEmbedUnimplementedFrontendForQuerierServer() {} 73 74 // UnsafeFrontendForQuerierServer may be embedded to opt out of forward compatibility for this service. 75 // Use of this interface is not recommended, as added methods to FrontendForQuerierServer will 76 // result in compilation errors. 77 type UnsafeFrontendForQuerierServer interface { 78 mustEmbedUnimplementedFrontendForQuerierServer() 79 } 80 81 func RegisterFrontendForQuerierServer(s grpc.ServiceRegistrar, srv FrontendForQuerierServer) { 82 s.RegisterService(&FrontendForQuerier_ServiceDesc, srv) 83 } 84 85 func _FrontendForQuerier_QueryResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 86 in := new(QueryResultRequest) 87 if err := dec(in); err != nil { 88 return nil, err 89 } 90 if interceptor == nil { 91 return srv.(FrontendForQuerierServer).QueryResult(ctx, in) 92 } 93 info := &grpc.UnaryServerInfo{ 94 Server: srv, 95 FullMethod: "/frontendpb.FrontendForQuerier/QueryResult", 96 } 97 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 98 return srv.(FrontendForQuerierServer).QueryResult(ctx, req.(*QueryResultRequest)) 99 } 100 return interceptor(ctx, in, info, handler) 101 } 102 103 // FrontendForQuerier_ServiceDesc is the grpc.ServiceDesc for FrontendForQuerier service. 104 // It's only intended for direct use with grpc.RegisterService, 105 // and not to be introspected or modified (even as a copy) 106 var FrontendForQuerier_ServiceDesc = grpc.ServiceDesc{ 107 ServiceName: "frontendpb.FrontendForQuerier", 108 HandlerType: (*FrontendForQuerierServer)(nil), 109 Methods: []grpc.MethodDesc{ 110 { 111 MethodName: "QueryResult", 112 Handler: _FrontendForQuerier_QueryResult_Handler, 113 }, 114 }, 115 Streams: []grpc.StreamDesc{}, 116 Metadata: "frontend/frontendpb/frontend.proto", 117 } 118 119 func (m *QueryResultRequest) MarshalVT() (dAtA []byte, err error) { 120 if m == nil { 121 return nil, nil 122 } 123 size := m.SizeVT() 124 dAtA = make([]byte, size) 125 n, err := m.MarshalToSizedBufferVT(dAtA[:size]) 126 if err != nil { 127 return nil, err 128 } 129 return dAtA[:n], nil 130 } 131 132 func (m *QueryResultRequest) MarshalToVT(dAtA []byte) (int, error) { 133 size := m.SizeVT() 134 return m.MarshalToSizedBufferVT(dAtA[:size]) 135 } 136 137 func (m *QueryResultRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { 138 if m == nil { 139 return 0, nil 140 } 141 i := len(dAtA) 142 _ = i 143 var l int 144 _ = l 145 if m.unknownFields != nil { 146 i -= len(m.unknownFields) 147 copy(dAtA[i:], m.unknownFields) 148 } 149 if m.Stats != nil { 150 if vtmsg, ok := interface{}(m.Stats).(interface { 151 MarshalToSizedBufferVT([]byte) (int, error) 152 }); ok { 153 size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) 154 if err != nil { 155 return 0, err 156 } 157 i -= size 158 i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) 159 } else { 160 encoded, err := proto.Marshal(m.Stats) 161 if err != nil { 162 return 0, err 163 } 164 i -= len(encoded) 165 copy(dAtA[i:], encoded) 166 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) 167 } 168 i-- 169 dAtA[i] = 0x1a 170 } 171 if m.HttpResponse != nil { 172 if vtmsg, ok := interface{}(m.HttpResponse).(interface { 173 MarshalToSizedBufferVT([]byte) (int, error) 174 }); ok { 175 size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) 176 if err != nil { 177 return 0, err 178 } 179 i -= size 180 i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) 181 } else { 182 encoded, err := proto.Marshal(m.HttpResponse) 183 if err != nil { 184 return 0, err 185 } 186 i -= len(encoded) 187 copy(dAtA[i:], encoded) 188 i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) 189 } 190 i-- 191 dAtA[i] = 0x12 192 } 193 if m.QueryID != 0 { 194 i = protohelpers.EncodeVarint(dAtA, i, uint64(m.QueryID)) 195 i-- 196 dAtA[i] = 0x8 197 } 198 return len(dAtA) - i, nil 199 } 200 201 func (m *QueryResultResponse) MarshalVT() (dAtA []byte, err error) { 202 if m == nil { 203 return nil, nil 204 } 205 size := m.SizeVT() 206 dAtA = make([]byte, size) 207 n, err := m.MarshalToSizedBufferVT(dAtA[:size]) 208 if err != nil { 209 return nil, err 210 } 211 return dAtA[:n], nil 212 } 213 214 func (m *QueryResultResponse) MarshalToVT(dAtA []byte) (int, error) { 215 size := m.SizeVT() 216 return m.MarshalToSizedBufferVT(dAtA[:size]) 217 } 218 219 func (m *QueryResultResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { 220 if m == nil { 221 return 0, nil 222 } 223 i := len(dAtA) 224 _ = i 225 var l int 226 _ = l 227 if m.unknownFields != nil { 228 i -= len(m.unknownFields) 229 copy(dAtA[i:], m.unknownFields) 230 } 231 return len(dAtA) - i, nil 232 } 233 234 func (m *QueryResultRequest) SizeVT() (n int) { 235 if m == nil { 236 return 0 237 } 238 var l int 239 _ = l 240 if m.QueryID != 0 { 241 n += 1 + protohelpers.SizeOfVarint(uint64(m.QueryID)) 242 } 243 if m.HttpResponse != nil { 244 if size, ok := interface{}(m.HttpResponse).(interface { 245 SizeVT() int 246 }); ok { 247 l = size.SizeVT() 248 } else { 249 l = proto.Size(m.HttpResponse) 250 } 251 n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) 252 } 253 if m.Stats != nil { 254 if size, ok := interface{}(m.Stats).(interface { 255 SizeVT() int 256 }); ok { 257 l = size.SizeVT() 258 } else { 259 l = proto.Size(m.Stats) 260 } 261 n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) 262 } 263 n += len(m.unknownFields) 264 return n 265 } 266 267 func (m *QueryResultResponse) SizeVT() (n int) { 268 if m == nil { 269 return 0 270 } 271 var l int 272 _ = l 273 n += len(m.unknownFields) 274 return n 275 } 276 277 func (m *QueryResultRequest) UnmarshalVT(dAtA []byte) error { 278 l := len(dAtA) 279 iNdEx := 0 280 for iNdEx < l { 281 preIndex := iNdEx 282 var wire uint64 283 for shift := uint(0); ; shift += 7 { 284 if shift >= 64 { 285 return protohelpers.ErrIntOverflow 286 } 287 if iNdEx >= l { 288 return io.ErrUnexpectedEOF 289 } 290 b := dAtA[iNdEx] 291 iNdEx++ 292 wire |= uint64(b&0x7F) << shift 293 if b < 0x80 { 294 break 295 } 296 } 297 fieldNum := int32(wire >> 3) 298 wireType := int(wire & 0x7) 299 if wireType == 4 { 300 return fmt.Errorf("proto: QueryResultRequest: wiretype end group for non-group") 301 } 302 if fieldNum <= 0 { 303 return fmt.Errorf("proto: QueryResultRequest: illegal tag %d (wire type %d)", fieldNum, wire) 304 } 305 switch fieldNum { 306 case 1: 307 if wireType != 0 { 308 return fmt.Errorf("proto: wrong wireType = %d for field QueryID", wireType) 309 } 310 m.QueryID = 0 311 for shift := uint(0); ; shift += 7 { 312 if shift >= 64 { 313 return protohelpers.ErrIntOverflow 314 } 315 if iNdEx >= l { 316 return io.ErrUnexpectedEOF 317 } 318 b := dAtA[iNdEx] 319 iNdEx++ 320 m.QueryID |= uint64(b&0x7F) << shift 321 if b < 0x80 { 322 break 323 } 324 } 325 case 2: 326 if wireType != 2 { 327 return fmt.Errorf("proto: wrong wireType = %d for field HttpResponse", wireType) 328 } 329 var msglen int 330 for shift := uint(0); ; shift += 7 { 331 if shift >= 64 { 332 return protohelpers.ErrIntOverflow 333 } 334 if iNdEx >= l { 335 return io.ErrUnexpectedEOF 336 } 337 b := dAtA[iNdEx] 338 iNdEx++ 339 msglen |= int(b&0x7F) << shift 340 if b < 0x80 { 341 break 342 } 343 } 344 if msglen < 0 { 345 return protohelpers.ErrInvalidLength 346 } 347 postIndex := iNdEx + msglen 348 if postIndex < 0 { 349 return protohelpers.ErrInvalidLength 350 } 351 if postIndex > l { 352 return io.ErrUnexpectedEOF 353 } 354 if m.HttpResponse == nil { 355 m.HttpResponse = &httpgrpc.HTTPResponse{} 356 } 357 if unmarshal, ok := interface{}(m.HttpResponse).(interface { 358 UnmarshalVT([]byte) error 359 }); ok { 360 if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { 361 return err 362 } 363 } else { 364 if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.HttpResponse); err != nil { 365 return err 366 } 367 } 368 iNdEx = postIndex 369 case 3: 370 if wireType != 2 { 371 return fmt.Errorf("proto: wrong wireType = %d for field Stats", wireType) 372 } 373 var msglen int 374 for shift := uint(0); ; shift += 7 { 375 if shift >= 64 { 376 return protohelpers.ErrIntOverflow 377 } 378 if iNdEx >= l { 379 return io.ErrUnexpectedEOF 380 } 381 b := dAtA[iNdEx] 382 iNdEx++ 383 msglen |= int(b&0x7F) << shift 384 if b < 0x80 { 385 break 386 } 387 } 388 if msglen < 0 { 389 return protohelpers.ErrInvalidLength 390 } 391 postIndex := iNdEx + msglen 392 if postIndex < 0 { 393 return protohelpers.ErrInvalidLength 394 } 395 if postIndex > l { 396 return io.ErrUnexpectedEOF 397 } 398 if m.Stats == nil { 399 m.Stats = &stats.Stats{} 400 } 401 if unmarshal, ok := interface{}(m.Stats).(interface { 402 UnmarshalVT([]byte) error 403 }); ok { 404 if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { 405 return err 406 } 407 } else { 408 if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Stats); err != nil { 409 return err 410 } 411 } 412 iNdEx = postIndex 413 default: 414 iNdEx = preIndex 415 skippy, err := protohelpers.Skip(dAtA[iNdEx:]) 416 if err != nil { 417 return err 418 } 419 if (skippy < 0) || (iNdEx+skippy) < 0 { 420 return protohelpers.ErrInvalidLength 421 } 422 if (iNdEx + skippy) > l { 423 return io.ErrUnexpectedEOF 424 } 425 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 426 iNdEx += skippy 427 } 428 } 429 430 if iNdEx > l { 431 return io.ErrUnexpectedEOF 432 } 433 return nil 434 } 435 func (m *QueryResultResponse) UnmarshalVT(dAtA []byte) error { 436 l := len(dAtA) 437 iNdEx := 0 438 for iNdEx < l { 439 preIndex := iNdEx 440 var wire uint64 441 for shift := uint(0); ; shift += 7 { 442 if shift >= 64 { 443 return protohelpers.ErrIntOverflow 444 } 445 if iNdEx >= l { 446 return io.ErrUnexpectedEOF 447 } 448 b := dAtA[iNdEx] 449 iNdEx++ 450 wire |= uint64(b&0x7F) << shift 451 if b < 0x80 { 452 break 453 } 454 } 455 fieldNum := int32(wire >> 3) 456 wireType := int(wire & 0x7) 457 if wireType == 4 { 458 return fmt.Errorf("proto: QueryResultResponse: wiretype end group for non-group") 459 } 460 if fieldNum <= 0 { 461 return fmt.Errorf("proto: QueryResultResponse: illegal tag %d (wire type %d)", fieldNum, wire) 462 } 463 switch fieldNum { 464 default: 465 iNdEx = preIndex 466 skippy, err := protohelpers.Skip(dAtA[iNdEx:]) 467 if err != nil { 468 return err 469 } 470 if (skippy < 0) || (iNdEx+skippy) < 0 { 471 return protohelpers.ErrInvalidLength 472 } 473 if (iNdEx + skippy) > l { 474 return io.ErrUnexpectedEOF 475 } 476 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 477 iNdEx += skippy 478 } 479 } 480 481 if iNdEx > l { 482 return io.ErrUnexpectedEOF 483 } 484 return nil 485 }