diff --git a/Makefile b/Makefile index 7164767a96..f81e2bba65 100644 --- a/Makefile +++ b/Makefile @@ -256,7 +256,7 @@ reference-help: go/bin $(BIN)/buf: Makefile @mkdir -p $(@D) - GOBIN=$(abspath $(@D)) $(GO) install github.com/bufbuild/buf/cmd/buf@v1.28.1 + GOBIN=$(abspath $(@D)) $(GO) install github.com/bufbuild/buf/cmd/buf@v1.31.0 $(BIN)/golangci-lint: Makefile @mkdir -p $(@D) @@ -264,7 +264,7 @@ $(BIN)/golangci-lint: Makefile $(BIN)/protoc-gen-go: Makefile go.mod @mkdir -p $(@D) - GOBIN=$(abspath $(@D)) $(GO) install google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0 + GOBIN=$(abspath $(@D)) $(GO) install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.1 $(BIN)/protoc-gen-connect-go: Makefile go.mod @mkdir -p $(@D) @@ -276,7 +276,7 @@ $(BIN)/protoc-gen-connect-go-mux: Makefile go.mod $(BIN)/protoc-gen-go-vtproto: Makefile go.mod @mkdir -p $(@D) - GOBIN=$(abspath $(@D)) $(GO) install github.com/grafana/vtprotobuf/cmd/protoc-gen-go-vtproto@5b3aae6571b83099f5a6cd803e8d72296550a973 + GOBIN=$(abspath $(@D)) $(GO) install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@v0.6.0 $(BIN)/protoc-gen-openapiv2: Makefile go.mod @mkdir -p $(@D) diff --git a/api/gen/proto/go/adhocprofiles/v1/adhocprofiles.pb.go b/api/gen/proto/go/adhocprofiles/v1/adhocprofiles.pb.go index 35181c8b7c..3a581b3aee 100644 --- a/api/gen/proto/go/adhocprofiles/v1/adhocprofiles.pb.go +++ b/api/gen/proto/go/adhocprofiles/v1/adhocprofiles.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: adhocprofiles/v1/adhocprofiles.proto diff --git a/api/gen/proto/go/adhocprofiles/v1/adhocprofiles_vtproto.pb.go b/api/gen/proto/go/adhocprofiles/v1/adhocprofiles_vtproto.pb.go index 8dad7cf3ae..051bad1e5a 100644 --- a/api/gen/proto/go/adhocprofiles/v1/adhocprofiles_vtproto.pb.go +++ b/api/gen/proto/go/adhocprofiles/v1/adhocprofiles_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: adhocprofiles/v1/adhocprofiles.proto package adhocprofilesv1 @@ -7,13 +7,13 @@ package adhocprofilesv1 import ( context "context" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -27,10 +27,9 @@ func (m *AdHocProfilesUploadRequest) CloneVT() *AdHocProfilesUploadRequest { if m == nil { return (*AdHocProfilesUploadRequest)(nil) } - r := &AdHocProfilesUploadRequest{ - Name: m.Name, - Profile: m.Profile, - } + r := new(AdHocProfilesUploadRequest) + r.Name = m.Name + r.Profile = m.Profile if rhs := m.MaxNodes; rhs != nil { tmpVal := *rhs r.MaxNodes = &tmpVal @@ -50,9 +49,8 @@ func (m *AdHocProfilesGetRequest) CloneVT() *AdHocProfilesGetRequest { if m == nil { return (*AdHocProfilesGetRequest)(nil) } - r := &AdHocProfilesGetRequest{ - Id: m.Id, - } + r := new(AdHocProfilesGetRequest) + r.Id = m.Id if rhs := m.ProfileType; rhs != nil { tmpVal := *rhs r.ProfileType = &tmpVal @@ -76,13 +74,12 @@ func (m *AdHocProfilesGetResponse) CloneVT() *AdHocProfilesGetResponse { if m == nil { return (*AdHocProfilesGetResponse)(nil) } - r := &AdHocProfilesGetResponse{ - Id: m.Id, - Name: m.Name, - UploadedAt: m.UploadedAt, - ProfileType: m.ProfileType, - FlamebearerProfile: m.FlamebearerProfile, - } + r := new(AdHocProfilesGetResponse) + r.Id = m.Id + r.Name = m.Name + r.UploadedAt = m.UploadedAt + r.ProfileType = m.ProfileType + r.FlamebearerProfile = m.FlamebearerProfile if rhs := m.ProfileTypes; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -103,7 +100,7 @@ func (m *AdHocProfilesListRequest) CloneVT() *AdHocProfilesListRequest { if m == nil { return (*AdHocProfilesListRequest)(nil) } - r := &AdHocProfilesListRequest{} + r := new(AdHocProfilesListRequest) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -119,7 +116,7 @@ func (m *AdHocProfilesListResponse) CloneVT() *AdHocProfilesListResponse { if m == nil { return (*AdHocProfilesListResponse)(nil) } - r := &AdHocProfilesListResponse{} + r := new(AdHocProfilesListResponse) if rhs := m.Profiles; rhs != nil { tmpContainer := make([]*AdHocProfilesProfileMetadata, len(rhs)) for k, v := range rhs { @@ -142,11 +139,10 @@ func (m *AdHocProfilesProfileMetadata) CloneVT() *AdHocProfilesProfileMetadata { if m == nil { return (*AdHocProfilesProfileMetadata)(nil) } - r := &AdHocProfilesProfileMetadata{ - Id: m.Id, - Name: m.Name, - UploadedAt: m.UploadedAt, - } + r := new(AdHocProfilesProfileMetadata) + r.Id = m.Id + r.Name = m.Name + r.UploadedAt = m.UploadedAt if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -527,21 +523,21 @@ func (m *AdHocProfilesUploadRequest) MarshalToSizedBufferVT(dAtA []byte) (int, e copy(dAtA[i:], m.unknownFields) } if m.MaxNodes != nil { - i = encodeVarint(dAtA, i, uint64(*m.MaxNodes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.MaxNodes)) i-- dAtA[i] = 0x18 } if len(m.Profile) > 0 { i -= len(m.Profile) copy(dAtA[i:], m.Profile) - i = encodeVarint(dAtA, i, uint64(len(m.Profile))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Profile))) i-- dAtA[i] = 0x12 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } @@ -579,21 +575,21 @@ func (m *AdHocProfilesGetRequest) MarshalToSizedBufferVT(dAtA []byte) (int, erro copy(dAtA[i:], m.unknownFields) } if m.MaxNodes != nil { - i = encodeVarint(dAtA, i, uint64(*m.MaxNodes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.MaxNodes)) i-- dAtA[i] = 0x18 } if m.ProfileType != nil { i -= len(*m.ProfileType) copy(dAtA[i:], *m.ProfileType) - i = encodeVarint(dAtA, i, uint64(len(*m.ProfileType))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(*m.ProfileType))) i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarint(dAtA, i, uint64(len(m.Id))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -633,7 +629,7 @@ func (m *AdHocProfilesGetResponse) MarshalToSizedBufferVT(dAtA []byte) (int, err if len(m.FlamebearerProfile) > 0 { i -= len(m.FlamebearerProfile) copy(dAtA[i:], m.FlamebearerProfile) - i = encodeVarint(dAtA, i, uint64(len(m.FlamebearerProfile))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.FlamebearerProfile))) i-- dAtA[i] = 0x32 } @@ -641,7 +637,7 @@ func (m *AdHocProfilesGetResponse) MarshalToSizedBufferVT(dAtA []byte) (int, err for iNdEx := len(m.ProfileTypes) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.ProfileTypes[iNdEx]) copy(dAtA[i:], m.ProfileTypes[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.ProfileTypes[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ProfileTypes[iNdEx]))) i-- dAtA[i] = 0x2a } @@ -649,26 +645,26 @@ func (m *AdHocProfilesGetResponse) MarshalToSizedBufferVT(dAtA []byte) (int, err if len(m.ProfileType) > 0 { i -= len(m.ProfileType) copy(dAtA[i:], m.ProfileType) - i = encodeVarint(dAtA, i, uint64(len(m.ProfileType))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ProfileType))) i-- dAtA[i] = 0x22 } if m.UploadedAt != 0 { - i = encodeVarint(dAtA, i, uint64(m.UploadedAt)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UploadedAt)) i-- dAtA[i] = 0x18 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarint(dAtA, i, uint64(len(m.Id))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } @@ -745,7 +741,7 @@ func (m *AdHocProfilesListResponse) MarshalToSizedBufferVT(dAtA []byte) (int, er return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -784,38 +780,27 @@ func (m *AdHocProfilesProfileMetadata) MarshalToSizedBufferVT(dAtA []byte) (int, copy(dAtA[i:], m.unknownFields) } if m.UploadedAt != 0 { - i = encodeVarint(dAtA, i, uint64(m.UploadedAt)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.UploadedAt)) i-- dAtA[i] = 0x18 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.Id) > 0 { i -= len(m.Id) copy(dAtA[i:], m.Id) - i = encodeVarint(dAtA, i, uint64(len(m.Id))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Id))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *AdHocProfilesUploadRequest) SizeVT() (n int) { if m == nil { return 0 @@ -824,14 +809,14 @@ func (m *AdHocProfilesUploadRequest) SizeVT() (n int) { _ = l l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Profile) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.MaxNodes != nil { - n += 1 + sov(uint64(*m.MaxNodes)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.MaxNodes)) } n += len(m.unknownFields) return n @@ -845,14 +830,14 @@ func (m *AdHocProfilesGetRequest) SizeVT() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.ProfileType != nil { l = len(*m.ProfileType) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.MaxNodes != nil { - n += 1 + sov(uint64(*m.MaxNodes)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.MaxNodes)) } n += len(m.unknownFields) return n @@ -866,28 +851,28 @@ func (m *AdHocProfilesGetResponse) SizeVT() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.UploadedAt != 0 { - n += 1 + sov(uint64(m.UploadedAt)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.UploadedAt)) } l = len(m.ProfileType) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.ProfileTypes) > 0 { for _, s := range m.ProfileTypes { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } l = len(m.FlamebearerProfile) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -912,7 +897,7 @@ func (m *AdHocProfilesListResponse) SizeVT() (n int) { if len(m.Profiles) > 0 { for _, e := range m.Profiles { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -927,25 +912,19 @@ func (m *AdHocProfilesProfileMetadata) SizeVT() (n int) { _ = l l = len(m.Id) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.UploadedAt != 0 { - n += 1 + sov(uint64(m.UploadedAt)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.UploadedAt)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *AdHocProfilesUploadRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -954,7 +933,7 @@ func (m *AdHocProfilesUploadRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -982,7 +961,7 @@ func (m *AdHocProfilesUploadRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -996,11 +975,11 @@ func (m *AdHocProfilesUploadRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1014,7 +993,7 @@ func (m *AdHocProfilesUploadRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1028,11 +1007,11 @@ func (m *AdHocProfilesUploadRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1046,7 +1025,7 @@ func (m *AdHocProfilesUploadRequest) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1061,12 +1040,12 @@ func (m *AdHocProfilesUploadRequest) UnmarshalVT(dAtA []byte) error { m.MaxNodes = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1089,7 +1068,7 @@ func (m *AdHocProfilesGetRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1117,7 +1096,7 @@ func (m *AdHocProfilesGetRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1131,11 +1110,11 @@ func (m *AdHocProfilesGetRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1149,7 +1128,7 @@ func (m *AdHocProfilesGetRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1163,11 +1142,11 @@ func (m *AdHocProfilesGetRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1182,7 +1161,7 @@ func (m *AdHocProfilesGetRequest) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1197,12 +1176,12 @@ func (m *AdHocProfilesGetRequest) UnmarshalVT(dAtA []byte) error { m.MaxNodes = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1225,7 +1204,7 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1253,7 +1232,7 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1267,11 +1246,11 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1285,7 +1264,7 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1299,11 +1278,11 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1317,7 +1296,7 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { m.UploadedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1336,7 +1315,7 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1350,11 +1329,11 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1368,7 +1347,7 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1382,11 +1361,11 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1400,7 +1379,7 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1414,11 +1393,11 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1427,12 +1406,12 @@ func (m *AdHocProfilesGetResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1455,7 +1434,7 @@ func (m *AdHocProfilesListRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1478,12 +1457,12 @@ func (m *AdHocProfilesListRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1506,7 +1485,7 @@ func (m *AdHocProfilesListResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1534,7 +1513,7 @@ func (m *AdHocProfilesListResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1547,11 +1526,11 @@ func (m *AdHocProfilesListResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1563,12 +1542,12 @@ func (m *AdHocProfilesListResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1591,7 +1570,7 @@ func (m *AdHocProfilesProfileMetadata) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1619,7 +1598,7 @@ func (m *AdHocProfilesProfileMetadata) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1633,11 +1612,11 @@ func (m *AdHocProfilesProfileMetadata) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1651,7 +1630,7 @@ func (m *AdHocProfilesProfileMetadata) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1665,11 +1644,11 @@ func (m *AdHocProfilesProfileMetadata) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1683,7 +1662,7 @@ func (m *AdHocProfilesProfileMetadata) UnmarshalVT(dAtA []byte) error { m.UploadedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1697,12 +1676,12 @@ func (m *AdHocProfilesProfileMetadata) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1717,88 +1696,3 @@ func (m *AdHocProfilesProfileMetadata) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/api/gen/proto/go/google/v1/profile.pb.go b/api/gen/proto/go/google/v1/profile.pb.go index acd2e527da..4df2323579 100644 --- a/api/gen/proto/go/google/v1/profile.pb.go +++ b/api/gen/proto/go/google/v1/profile.pb.go @@ -38,7 +38,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: google/v1/profile.proto diff --git a/api/gen/proto/go/google/v1/profile_vtproto.pb.go b/api/gen/proto/go/google/v1/profile_vtproto.pb.go index b226a63f9c..2270d2b79b 100644 --- a/api/gen/proto/go/google/v1/profile_vtproto.pb.go +++ b/api/gen/proto/go/google/v1/profile_vtproto.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: google/v1/profile.proto package googlev1 import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -23,15 +23,14 @@ func (m *Profile) CloneVT() *Profile { if m == nil { return (*Profile)(nil) } - r := &Profile{ - DropFrames: m.DropFrames, - KeepFrames: m.KeepFrames, - TimeNanos: m.TimeNanos, - DurationNanos: m.DurationNanos, - PeriodType: m.PeriodType.CloneVT(), - Period: m.Period, - DefaultSampleType: m.DefaultSampleType, - } + r := new(Profile) + r.DropFrames = m.DropFrames + r.KeepFrames = m.KeepFrames + r.TimeNanos = m.TimeNanos + r.DurationNanos = m.DurationNanos + r.PeriodType = m.PeriodType.CloneVT() + r.Period = m.Period + r.DefaultSampleType = m.DefaultSampleType if rhs := m.SampleType; rhs != nil { tmpContainer := make([]*ValueType, len(rhs)) for k, v := range rhs { @@ -92,10 +91,9 @@ func (m *ValueType) CloneVT() *ValueType { if m == nil { return (*ValueType)(nil) } - r := &ValueType{ - Type: m.Type, - Unit: m.Unit, - } + r := new(ValueType) + r.Type = m.Type + r.Unit = m.Unit if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -111,7 +109,7 @@ func (m *Sample) CloneVT() *Sample { if m == nil { return (*Sample)(nil) } - r := &Sample{} + r := new(Sample) if rhs := m.LocationId; rhs != nil { tmpContainer := make([]uint64, len(rhs)) copy(tmpContainer, rhs) @@ -144,12 +142,11 @@ func (m *Label) CloneVT() *Label { if m == nil { return (*Label)(nil) } - r := &Label{ - Key: m.Key, - Str: m.Str, - Num: m.Num, - NumUnit: m.NumUnit, - } + r := new(Label) + r.Key = m.Key + r.Str = m.Str + r.Num = m.Num + r.NumUnit = m.NumUnit if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -165,18 +162,17 @@ func (m *Mapping) CloneVT() *Mapping { if m == nil { return (*Mapping)(nil) } - r := &Mapping{ - Id: m.Id, - MemoryStart: m.MemoryStart, - MemoryLimit: m.MemoryLimit, - FileOffset: m.FileOffset, - Filename: m.Filename, - BuildId: m.BuildId, - HasFunctions: m.HasFunctions, - HasFilenames: m.HasFilenames, - HasLineNumbers: m.HasLineNumbers, - HasInlineFrames: m.HasInlineFrames, - } + r := new(Mapping) + r.Id = m.Id + r.MemoryStart = m.MemoryStart + r.MemoryLimit = m.MemoryLimit + r.FileOffset = m.FileOffset + r.Filename = m.Filename + r.BuildId = m.BuildId + r.HasFunctions = m.HasFunctions + r.HasFilenames = m.HasFilenames + r.HasLineNumbers = m.HasLineNumbers + r.HasInlineFrames = m.HasInlineFrames if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -192,12 +188,11 @@ func (m *Location) CloneVT() *Location { if m == nil { return (*Location)(nil) } - r := &Location{ - Id: m.Id, - MappingId: m.MappingId, - Address: m.Address, - IsFolded: m.IsFolded, - } + r := new(Location) + r.Id = m.Id + r.MappingId = m.MappingId + r.Address = m.Address + r.IsFolded = m.IsFolded if rhs := m.Line; rhs != nil { tmpContainer := make([]*Line, len(rhs)) for k, v := range rhs { @@ -220,10 +215,9 @@ func (m *Line) CloneVT() *Line { if m == nil { return (*Line)(nil) } - r := &Line{ - FunctionId: m.FunctionId, - Line: m.Line, - } + r := new(Line) + r.FunctionId = m.FunctionId + r.Line = m.Line if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -239,13 +233,12 @@ func (m *Function) CloneVT() *Function { if m == nil { return (*Function)(nil) } - r := &Function{ - Id: m.Id, - Name: m.Name, - SystemName: m.SystemName, - Filename: m.Filename, - StartLine: m.StartLine, - } + r := new(Function) + r.Id = m.Id + r.Name = m.Name + r.SystemName = m.SystemName + r.Filename = m.Filename + r.StartLine = m.StartLine if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -673,14 +666,14 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.DefaultSampleType != 0 { - i = encodeVarint(dAtA, i, uint64(m.DefaultSampleType)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DefaultSampleType)) i-- dAtA[i] = 0x70 } if len(m.Comment) > 0 { var pksize2 int for _, num := range m.Comment { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -694,12 +687,12 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x6a } if m.Period != 0 { - i = encodeVarint(dAtA, i, uint64(m.Period)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Period)) i-- dAtA[i] = 0x60 } @@ -709,27 +702,27 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x5a } if m.DurationNanos != 0 { - i = encodeVarint(dAtA, i, uint64(m.DurationNanos)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DurationNanos)) i-- dAtA[i] = 0x50 } if m.TimeNanos != 0 { - i = encodeVarint(dAtA, i, uint64(m.TimeNanos)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TimeNanos)) i-- dAtA[i] = 0x48 } if m.KeepFrames != 0 { - i = encodeVarint(dAtA, i, uint64(m.KeepFrames)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.KeepFrames)) i-- dAtA[i] = 0x40 } if m.DropFrames != 0 { - i = encodeVarint(dAtA, i, uint64(m.DropFrames)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DropFrames)) i-- dAtA[i] = 0x38 } @@ -737,7 +730,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.StringTable) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.StringTable[iNdEx]) copy(dAtA[i:], m.StringTable[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.StringTable[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StringTable[iNdEx]))) i-- dAtA[i] = 0x32 } @@ -749,7 +742,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -761,7 +754,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -773,7 +766,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -785,7 +778,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -797,7 +790,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -836,12 +829,12 @@ func (m *ValueType) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.Unit != 0 { - i = encodeVarint(dAtA, i, uint64(m.Unit)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Unit)) i-- dAtA[i] = 0x10 } if m.Type != 0 { - i = encodeVarint(dAtA, i, uint64(m.Type)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) i-- dAtA[i] = 0x8 } @@ -885,7 +878,7 @@ func (m *Sample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -893,7 +886,7 @@ func (m *Sample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Value) > 0 { var pksize2 int for _, num := range m.Value { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -907,14 +900,14 @@ func (m *Sample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x12 } if len(m.LocationId) > 0 { var pksize4 int for _, num := range m.LocationId { - pksize4 += sov(uint64(num)) + pksize4 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize4 j3 := i @@ -927,7 +920,7 @@ func (m *Sample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j3] = uint8(num) j3++ } - i = encodeVarint(dAtA, i, uint64(pksize4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize4)) i-- dAtA[i] = 0xa } @@ -965,22 +958,22 @@ func (m *Label) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.NumUnit != 0 { - i = encodeVarint(dAtA, i, uint64(m.NumUnit)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NumUnit)) i-- dAtA[i] = 0x20 } if m.Num != 0 { - i = encodeVarint(dAtA, i, uint64(m.Num)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Num)) i-- dAtA[i] = 0x18 } if m.Str != 0 { - i = encodeVarint(dAtA, i, uint64(m.Str)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Str)) i-- dAtA[i] = 0x10 } if m.Key != 0 { - i = encodeVarint(dAtA, i, uint64(m.Key)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Key)) i-- dAtA[i] = 0x8 } @@ -1058,32 +1051,32 @@ func (m *Mapping) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x38 } if m.BuildId != 0 { - i = encodeVarint(dAtA, i, uint64(m.BuildId)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BuildId)) i-- dAtA[i] = 0x30 } if m.Filename != 0 { - i = encodeVarint(dAtA, i, uint64(m.Filename)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Filename)) i-- dAtA[i] = 0x28 } if m.FileOffset != 0 { - i = encodeVarint(dAtA, i, uint64(m.FileOffset)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FileOffset)) i-- dAtA[i] = 0x20 } if m.MemoryLimit != 0 { - i = encodeVarint(dAtA, i, uint64(m.MemoryLimit)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MemoryLimit)) i-- dAtA[i] = 0x18 } if m.MemoryStart != 0 { - i = encodeVarint(dAtA, i, uint64(m.MemoryStart)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MemoryStart)) i-- dAtA[i] = 0x10 } if m.Id != 0 { - i = encodeVarint(dAtA, i, uint64(m.Id)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -1137,23 +1130,23 @@ func (m *Location) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } } if m.Address != 0 { - i = encodeVarint(dAtA, i, uint64(m.Address)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Address)) i-- dAtA[i] = 0x18 } if m.MappingId != 0 { - i = encodeVarint(dAtA, i, uint64(m.MappingId)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MappingId)) i-- dAtA[i] = 0x10 } if m.Id != 0 { - i = encodeVarint(dAtA, i, uint64(m.Id)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -1191,12 +1184,12 @@ func (m *Line) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.Line != 0 { - i = encodeVarint(dAtA, i, uint64(m.Line)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Line)) i-- dAtA[i] = 0x10 } if m.FunctionId != 0 { - i = encodeVarint(dAtA, i, uint64(m.FunctionId)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FunctionId)) i-- dAtA[i] = 0x8 } @@ -1234,44 +1227,33 @@ func (m *Function) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.StartLine != 0 { - i = encodeVarint(dAtA, i, uint64(m.StartLine)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StartLine)) i-- dAtA[i] = 0x28 } if m.Filename != 0 { - i = encodeVarint(dAtA, i, uint64(m.Filename)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Filename)) i-- dAtA[i] = 0x20 } if m.SystemName != 0 { - i = encodeVarint(dAtA, i, uint64(m.SystemName)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SystemName)) i-- dAtA[i] = 0x18 } if m.Name != 0 { - i = encodeVarint(dAtA, i, uint64(m.Name)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Name)) i-- dAtA[i] = 0x10 } if m.Id != 0 { - i = encodeVarint(dAtA, i, uint64(m.Id)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *Profile) SizeVT() (n int) { if m == nil { return 0 @@ -1281,67 +1263,67 @@ func (m *Profile) SizeVT() (n int) { if len(m.SampleType) > 0 { for _, e := range m.SampleType { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Sample) > 0 { for _, e := range m.Sample { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Mapping) > 0 { for _, e := range m.Mapping { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Location) > 0 { for _, e := range m.Location { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Function) > 0 { for _, e := range m.Function { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.StringTable) > 0 { for _, s := range m.StringTable { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.DropFrames != 0 { - n += 1 + sov(uint64(m.DropFrames)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.DropFrames)) } if m.KeepFrames != 0 { - n += 1 + sov(uint64(m.KeepFrames)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.KeepFrames)) } if m.TimeNanos != 0 { - n += 1 + sov(uint64(m.TimeNanos)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.TimeNanos)) } if m.DurationNanos != 0 { - n += 1 + sov(uint64(m.DurationNanos)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.DurationNanos)) } if m.PeriodType != nil { l = m.PeriodType.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Period != 0 { - n += 1 + sov(uint64(m.Period)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Period)) } if len(m.Comment) > 0 { l = 0 for _, e := range m.Comment { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } if m.DefaultSampleType != 0 { - n += 1 + sov(uint64(m.DefaultSampleType)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.DefaultSampleType)) } n += len(m.unknownFields) return n @@ -1354,10 +1336,10 @@ func (m *ValueType) SizeVT() (n int) { var l int _ = l if m.Type != 0 { - n += 1 + sov(uint64(m.Type)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) } if m.Unit != 0 { - n += 1 + sov(uint64(m.Unit)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Unit)) } n += len(m.unknownFields) return n @@ -1372,21 +1354,21 @@ func (m *Sample) SizeVT() (n int) { if len(m.LocationId) > 0 { l = 0 for _, e := range m.LocationId { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.Value) > 0 { l = 0 for _, e := range m.Value { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.Label) > 0 { for _, e := range m.Label { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1400,16 +1382,16 @@ func (m *Label) SizeVT() (n int) { var l int _ = l if m.Key != 0 { - n += 1 + sov(uint64(m.Key)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Key)) } if m.Str != 0 { - n += 1 + sov(uint64(m.Str)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Str)) } if m.Num != 0 { - n += 1 + sov(uint64(m.Num)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Num)) } if m.NumUnit != 0 { - n += 1 + sov(uint64(m.NumUnit)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.NumUnit)) } n += len(m.unknownFields) return n @@ -1422,22 +1404,22 @@ func (m *Mapping) SizeVT() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sov(uint64(m.Id)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Id)) } if m.MemoryStart != 0 { - n += 1 + sov(uint64(m.MemoryStart)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MemoryStart)) } if m.MemoryLimit != 0 { - n += 1 + sov(uint64(m.MemoryLimit)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MemoryLimit)) } if m.FileOffset != 0 { - n += 1 + sov(uint64(m.FileOffset)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.FileOffset)) } if m.Filename != 0 { - n += 1 + sov(uint64(m.Filename)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Filename)) } if m.BuildId != 0 { - n += 1 + sov(uint64(m.BuildId)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.BuildId)) } if m.HasFunctions { n += 2 @@ -1462,18 +1444,18 @@ func (m *Location) SizeVT() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sov(uint64(m.Id)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Id)) } if m.MappingId != 0 { - n += 1 + sov(uint64(m.MappingId)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MappingId)) } if m.Address != 0 { - n += 1 + sov(uint64(m.Address)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Address)) } if len(m.Line) > 0 { for _, e := range m.Line { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.IsFolded { @@ -1490,10 +1472,10 @@ func (m *Line) SizeVT() (n int) { var l int _ = l if m.FunctionId != 0 { - n += 1 + sov(uint64(m.FunctionId)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.FunctionId)) } if m.Line != 0 { - n += 1 + sov(uint64(m.Line)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Line)) } n += len(m.unknownFields) return n @@ -1506,30 +1488,24 @@ func (m *Function) SizeVT() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sov(uint64(m.Id)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Id)) } if m.Name != 0 { - n += 1 + sov(uint64(m.Name)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Name)) } if m.SystemName != 0 { - n += 1 + sov(uint64(m.SystemName)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SystemName)) } if m.Filename != 0 { - n += 1 + sov(uint64(m.Filename)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Filename)) } if m.StartLine != 0 { - n += 1 + sov(uint64(m.StartLine)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartLine)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *Profile) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1538,7 +1514,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1566,7 +1542,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1579,11 +1555,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1600,7 +1576,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1613,11 +1589,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1634,7 +1610,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1647,11 +1623,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1668,7 +1644,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1681,11 +1657,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1702,7 +1678,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1715,11 +1691,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1736,7 +1712,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1750,11 +1726,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1768,7 +1744,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.DropFrames = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1787,7 +1763,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.KeepFrames = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1806,7 +1782,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.TimeNanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1825,7 +1801,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.DurationNanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1844,7 +1820,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1857,11 +1833,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1880,7 +1856,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.Period = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1897,7 +1873,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1914,7 +1890,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1927,11 +1903,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1951,7 +1927,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1975,7 +1951,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.DefaultSampleType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1989,12 +1965,12 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2017,7 +1993,7 @@ func (m *ValueType) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2045,7 +2021,7 @@ func (m *ValueType) UnmarshalVT(dAtA []byte) error { m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2064,7 +2040,7 @@ func (m *ValueType) UnmarshalVT(dAtA []byte) error { m.Unit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2078,12 +2054,12 @@ func (m *ValueType) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2106,7 +2082,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2132,7 +2108,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2149,7 +2125,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2162,11 +2138,11 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2186,7 +2162,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2208,7 +2184,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2225,7 +2201,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2238,11 +2214,11 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2262,7 +2238,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2286,7 +2262,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2299,11 +2275,11 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2315,12 +2291,12 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2343,7 +2319,7 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2371,7 +2347,7 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { m.Key = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2390,7 +2366,7 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { m.Str = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2409,7 +2385,7 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { m.Num = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2428,7 +2404,7 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { m.NumUnit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2442,12 +2418,12 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2470,7 +2446,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2498,7 +2474,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2517,7 +2493,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.MemoryStart = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2536,7 +2512,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.MemoryLimit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2555,7 +2531,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.FileOffset = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2574,7 +2550,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.Filename = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2593,7 +2569,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.BuildId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2612,7 +2588,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2632,7 +2608,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2652,7 +2628,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2672,7 +2648,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2687,12 +2663,12 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.HasInlineFrames = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2715,7 +2691,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2743,7 +2719,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2762,7 +2738,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { m.MappingId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2781,7 +2757,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { m.Address = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2800,7 +2776,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2813,11 +2789,11 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2834,7 +2810,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2849,12 +2825,12 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { m.IsFolded = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2877,7 +2853,7 @@ func (m *Line) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2905,7 +2881,7 @@ func (m *Line) UnmarshalVT(dAtA []byte) error { m.FunctionId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2924,7 +2900,7 @@ func (m *Line) UnmarshalVT(dAtA []byte) error { m.Line = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2938,12 +2914,12 @@ func (m *Line) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2966,7 +2942,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2994,7 +2970,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3013,7 +2989,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { m.Name = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3032,7 +3008,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { m.SystemName = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3051,7 +3027,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { m.Filename = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3070,7 +3046,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { m.StartLine = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3084,12 +3060,12 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3104,88 +3080,3 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/api/gen/proto/go/ingester/v1/ingester.pb.go b/api/gen/proto/go/ingester/v1/ingester.pb.go index fa7e443cfb..09928c4b9f 100644 --- a/api/gen/proto/go/ingester/v1/ingester.pb.go +++ b/api/gen/proto/go/ingester/v1/ingester.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: ingester/v1/ingester.proto diff --git a/api/gen/proto/go/ingester/v1/ingester_vtproto.pb.go b/api/gen/proto/go/ingester/v1/ingester_vtproto.pb.go index 286c2b25c9..30f26068b1 100644 --- a/api/gen/proto/go/ingester/v1/ingester_vtproto.pb.go +++ b/api/gen/proto/go/ingester/v1/ingester_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: ingester/v1/ingester.proto package ingesterv1 @@ -9,13 +9,13 @@ import ( fmt "fmt" v11 "github.com/grafana/pyroscope/api/gen/proto/go/push/v1" v1 "github.com/grafana/pyroscope/api/gen/proto/go/types/v1" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -29,10 +29,9 @@ func (m *ProfileTypesRequest) CloneVT() *ProfileTypesRequest { if m == nil { return (*ProfileTypesRequest)(nil) } - r := &ProfileTypesRequest{ - Start: m.Start, - End: m.End, - } + r := new(ProfileTypesRequest) + r.Start = m.Start + r.End = m.End if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -48,7 +47,7 @@ func (m *ProfileTypesResponse) CloneVT() *ProfileTypesResponse { if m == nil { return (*ProfileTypesResponse)(nil) } - r := &ProfileTypesResponse{} + r := new(ProfileTypesResponse) if rhs := m.ProfileTypes; rhs != nil { tmpContainer := make([]*v1.ProfileType, len(rhs)) for k, v := range rhs { @@ -75,10 +74,9 @@ func (m *SeriesRequest) CloneVT() *SeriesRequest { if m == nil { return (*SeriesRequest)(nil) } - r := &SeriesRequest{ - Start: m.Start, - End: m.End, - } + r := new(SeriesRequest) + r.Start = m.Start + r.End = m.End if rhs := m.Matchers; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -104,7 +102,7 @@ func (m *SeriesResponse) CloneVT() *SeriesResponse { if m == nil { return (*SeriesResponse)(nil) } - r := &SeriesResponse{} + r := new(SeriesResponse) if rhs := m.LabelsSet; rhs != nil { tmpContainer := make([]*v1.Labels, len(rhs)) for k, v := range rhs { @@ -131,7 +129,7 @@ func (m *FlushRequest) CloneVT() *FlushRequest { if m == nil { return (*FlushRequest)(nil) } - r := &FlushRequest{} + r := new(FlushRequest) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -147,7 +145,7 @@ func (m *FlushResponse) CloneVT() *FlushResponse { if m == nil { return (*FlushResponse)(nil) } - r := &FlushResponse{} + r := new(FlushResponse) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -163,12 +161,11 @@ func (m *SelectProfilesRequest) CloneVT() *SelectProfilesRequest { if m == nil { return (*SelectProfilesRequest)(nil) } - r := &SelectProfilesRequest{ - LabelSelector: m.LabelSelector, - Start: m.Start, - End: m.End, - Hints: m.Hints.CloneVT(), - } + r := new(SelectProfilesRequest) + r.LabelSelector = m.LabelSelector + r.Start = m.Start + r.End = m.End + r.Hints = m.Hints.CloneVT() if rhs := m.Type; rhs != nil { if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *v1.ProfileType }); ok { r.Type = vtpb.CloneVT() @@ -195,9 +192,8 @@ func (m *MergeProfilesStacktracesRequest) CloneVT() *MergeProfilesStacktracesReq if m == nil { return (*MergeProfilesStacktracesRequest)(nil) } - r := &MergeProfilesStacktracesRequest{ - Request: m.Request.CloneVT(), - } + r := new(MergeProfilesStacktracesRequest) + r.Request = m.Request.CloneVT() if rhs := m.MaxNodes; rhs != nil { tmpVal := *rhs r.MaxNodes = &tmpVal @@ -222,9 +218,8 @@ func (m *MergeProfilesStacktracesResult) CloneVT() *MergeProfilesStacktracesResu if m == nil { return (*MergeProfilesStacktracesResult)(nil) } - r := &MergeProfilesStacktracesResult{ - Format: m.Format, - } + r := new(MergeProfilesStacktracesResult) + r.Format = m.Format if rhs := m.Stacktraces; rhs != nil { tmpContainer := make([]*StacktraceSample, len(rhs)) for k, v := range rhs { @@ -257,10 +252,9 @@ func (m *MergeProfilesStacktracesResponse) CloneVT() *MergeProfilesStacktracesRe if m == nil { return (*MergeProfilesStacktracesResponse)(nil) } - r := &MergeProfilesStacktracesResponse{ - SelectedProfiles: m.SelectedProfiles.CloneVT(), - Result: m.Result.CloneVT(), - } + r := new(MergeProfilesStacktracesResponse) + r.SelectedProfiles = m.SelectedProfiles.CloneVT() + r.Result = m.Result.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -276,12 +270,11 @@ func (m *SelectSpanProfileRequest) CloneVT() *SelectSpanProfileRequest { if m == nil { return (*SelectSpanProfileRequest)(nil) } - r := &SelectSpanProfileRequest{ - LabelSelector: m.LabelSelector, - Start: m.Start, - End: m.End, - Hints: m.Hints.CloneVT(), - } + r := new(SelectSpanProfileRequest) + r.LabelSelector = m.LabelSelector + r.Start = m.Start + r.End = m.End + r.Hints = m.Hints.CloneVT() if rhs := m.Type; rhs != nil { if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *v1.ProfileType }); ok { r.Type = vtpb.CloneVT() @@ -309,9 +302,8 @@ func (m *MergeSpanProfileRequest) CloneVT() *MergeSpanProfileRequest { if m == nil { return (*MergeSpanProfileRequest)(nil) } - r := &MergeSpanProfileRequest{ - Request: m.Request.CloneVT(), - } + r := new(MergeSpanProfileRequest) + r.Request = m.Request.CloneVT() if rhs := m.MaxNodes; rhs != nil { tmpVal := *rhs r.MaxNodes = &tmpVal @@ -336,10 +328,9 @@ func (m *MergeSpanProfileResponse) CloneVT() *MergeSpanProfileResponse { if m == nil { return (*MergeSpanProfileResponse)(nil) } - r := &MergeSpanProfileResponse{ - SelectedProfiles: m.SelectedProfiles.CloneVT(), - Result: m.Result.CloneVT(), - } + r := new(MergeSpanProfileResponse) + r.SelectedProfiles = m.SelectedProfiles.CloneVT() + r.Result = m.Result.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -355,7 +346,7 @@ func (m *MergeSpanProfileResult) CloneVT() *MergeSpanProfileResult { if m == nil { return (*MergeSpanProfileResult)(nil) } - r := &MergeSpanProfileResult{} + r := new(MergeSpanProfileResult) if rhs := m.TreeBytes; rhs != nil { tmpBytes := make([]byte, len(rhs)) copy(tmpBytes, rhs) @@ -376,7 +367,7 @@ func (m *ProfileSets) CloneVT() *ProfileSets { if m == nil { return (*ProfileSets)(nil) } - r := &ProfileSets{} + r := new(ProfileSets) if rhs := m.LabelsSets; rhs != nil { tmpContainer := make([]*v1.Labels, len(rhs)) for k, v := range rhs { @@ -410,10 +401,9 @@ func (m *SeriesProfile) CloneVT() *SeriesProfile { if m == nil { return (*SeriesProfile)(nil) } - r := &SeriesProfile{ - LabelIndex: m.LabelIndex, - Timestamp: m.Timestamp, - } + r := new(SeriesProfile) + r.LabelIndex = m.LabelIndex + r.Timestamp = m.Timestamp if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -429,10 +419,9 @@ func (m *Profile) CloneVT() *Profile { if m == nil { return (*Profile)(nil) } - r := &Profile{ - ID: m.ID, - Timestamp: m.Timestamp, - } + r := new(Profile) + r.ID = m.ID + r.Timestamp = m.Timestamp if rhs := m.Type; rhs != nil { if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *v1.ProfileType }); ok { r.Type = vtpb.CloneVT() @@ -473,9 +462,8 @@ func (m *StacktraceSample) CloneVT() *StacktraceSample { if m == nil { return (*StacktraceSample)(nil) } - r := &StacktraceSample{ - Value: m.Value, - } + r := new(StacktraceSample) + r.Value = m.Value if rhs := m.FunctionIds; rhs != nil { tmpContainer := make([]int32, len(rhs)) copy(tmpContainer, rhs) @@ -496,9 +484,8 @@ func (m *MergeProfilesLabelsRequest) CloneVT() *MergeProfilesLabelsRequest { if m == nil { return (*MergeProfilesLabelsRequest)(nil) } - r := &MergeProfilesLabelsRequest{ - Request: m.Request.CloneVT(), - } + r := new(MergeProfilesLabelsRequest) + r.Request = m.Request.CloneVT() if rhs := m.By; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -531,9 +518,8 @@ func (m *MergeProfilesLabelsResponse) CloneVT() *MergeProfilesLabelsResponse { if m == nil { return (*MergeProfilesLabelsResponse)(nil) } - r := &MergeProfilesLabelsResponse{ - SelectedProfiles: m.SelectedProfiles.CloneVT(), - } + r := new(MergeProfilesLabelsResponse) + r.SelectedProfiles = m.SelectedProfiles.CloneVT() if rhs := m.Series; rhs != nil { tmpContainer := make([]*v1.Series, len(rhs)) for k, v := range rhs { @@ -560,9 +546,8 @@ func (m *MergeProfilesPprofRequest) CloneVT() *MergeProfilesPprofRequest { if m == nil { return (*MergeProfilesPprofRequest)(nil) } - r := &MergeProfilesPprofRequest{ - Request: m.Request.CloneVT(), - } + r := new(MergeProfilesPprofRequest) + r.Request = m.Request.CloneVT() if rhs := m.MaxNodes; rhs != nil { tmpVal := *rhs r.MaxNodes = &tmpVal @@ -594,9 +579,8 @@ func (m *MergeProfilesPprofResponse) CloneVT() *MergeProfilesPprofResponse { if m == nil { return (*MergeProfilesPprofResponse)(nil) } - r := &MergeProfilesPprofResponse{ - SelectedProfiles: m.SelectedProfiles.CloneVT(), - } + r := new(MergeProfilesPprofResponse) + r.SelectedProfiles = m.SelectedProfiles.CloneVT() if rhs := m.Result; rhs != nil { tmpBytes := make([]byte, len(rhs)) copy(tmpBytes, rhs) @@ -617,10 +601,9 @@ func (m *BlockMetadataRequest) CloneVT() *BlockMetadataRequest { if m == nil { return (*BlockMetadataRequest)(nil) } - r := &BlockMetadataRequest{ - Start: m.Start, - End: m.End, - } + r := new(BlockMetadataRequest) + r.Start = m.Start + r.End = m.End if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -636,7 +619,7 @@ func (m *BlockMetadataResponse) CloneVT() *BlockMetadataResponse { if m == nil { return (*BlockMetadataResponse)(nil) } - r := &BlockMetadataResponse{} + r := new(BlockMetadataResponse) if rhs := m.Blocks; rhs != nil { tmpContainer := make([]*v1.BlockInfo, len(rhs)) for k, v := range rhs { @@ -663,9 +646,8 @@ func (m *Hints) CloneVT() *Hints { if m == nil { return (*Hints)(nil) } - r := &Hints{ - Block: m.Block.CloneVT(), - } + r := new(Hints) + r.Block = m.Block.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -681,9 +663,8 @@ func (m *BlockHints) CloneVT() *BlockHints { if m == nil { return (*BlockHints)(nil) } - r := &BlockHints{ - Deduplication: m.Deduplication, - } + r := new(BlockHints) + r.Deduplication = m.Deduplication if rhs := m.Ulids; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -704,7 +685,7 @@ func (m *GetBlockStatsRequest) CloneVT() *GetBlockStatsRequest { if m == nil { return (*GetBlockStatsRequest)(nil) } - r := &GetBlockStatsRequest{} + r := new(GetBlockStatsRequest) if rhs := m.Ulids; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -725,7 +706,7 @@ func (m *GetBlockStatsResponse) CloneVT() *GetBlockStatsResponse { if m == nil { return (*GetBlockStatsResponse)(nil) } - r := &GetBlockStatsResponse{} + r := new(GetBlockStatsResponse) if rhs := m.BlockStats; rhs != nil { tmpContainer := make([]*BlockStats, len(rhs)) for k, v := range rhs { @@ -748,14 +729,13 @@ func (m *BlockStats) CloneVT() *BlockStats { if m == nil { return (*BlockStats)(nil) } - r := &BlockStats{ - SeriesCount: m.SeriesCount, - ProfileCount: m.ProfileCount, - SampleCount: m.SampleCount, - IndexBytes: m.IndexBytes, - ProfileBytes: m.ProfileBytes, - SymbolBytes: m.SymbolBytes, - } + r := new(BlockStats) + r.SeriesCount = m.SeriesCount + r.ProfileCount = m.ProfileCount + r.SampleCount = m.SampleCount + r.IndexBytes = m.IndexBytes + r.ProfileBytes = m.ProfileBytes + r.SymbolBytes = m.SymbolBytes if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -2397,12 +2377,12 @@ func (m *ProfileTypesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x10 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x8 } @@ -2449,7 +2429,7 @@ func (m *ProfileTypesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.ProfileTypes[iNdEx]) if err != nil { @@ -2457,7 +2437,7 @@ func (m *ProfileTypesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0xa @@ -2497,12 +2477,12 @@ func (m *SeriesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x20 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x18 } @@ -2510,7 +2490,7 @@ func (m *SeriesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.LabelNames) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.LabelNames[iNdEx]) copy(dAtA[i:], m.LabelNames[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.LabelNames[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LabelNames[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -2519,7 +2499,7 @@ func (m *SeriesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Matchers[iNdEx]) copy(dAtA[i:], m.Matchers[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Matchers[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Matchers[iNdEx]))) i-- dAtA[i] = 0xa } @@ -2567,7 +2547,7 @@ func (m *SeriesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.LabelsSet[iNdEx]) if err != nil { @@ -2575,7 +2555,7 @@ func (m *SeriesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 @@ -2681,7 +2661,7 @@ func (m *SelectProfilesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) copy(dAtA[i:], m.unknownFields) } if m.Aggregation != nil { - i = encodeVarint(dAtA, i, uint64(*m.Aggregation)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Aggregation)) i-- dAtA[i] = 0x30 } @@ -2691,17 +2671,17 @@ func (m *SelectProfilesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x20 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x18 } @@ -2714,7 +2694,7 @@ func (m *SelectProfilesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Type) if err != nil { @@ -2722,7 +2702,7 @@ func (m *SelectProfilesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 @@ -2730,7 +2710,7 @@ func (m *SelectProfilesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) if len(m.LabelSelector) > 0 { i -= len(m.LabelSelector) copy(dAtA[i:], m.LabelSelector) - i = encodeVarint(dAtA, i, uint64(len(m.LabelSelector))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LabelSelector))) i-- dAtA[i] = 0xa } @@ -2768,7 +2748,7 @@ func (m *MergeProfilesStacktracesRequest) MarshalToSizedBufferVT(dAtA []byte) (i copy(dAtA[i:], m.unknownFields) } if m.MaxNodes != nil { - i = encodeVarint(dAtA, i, uint64(*m.MaxNodes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.MaxNodes)) i-- dAtA[i] = 0x18 } @@ -2781,7 +2761,7 @@ func (m *MergeProfilesStacktracesRequest) MarshalToSizedBufferVT(dAtA []byte) (i dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.Profiles))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Profiles))) i-- dAtA[i] = 0x12 } @@ -2791,7 +2771,7 @@ func (m *MergeProfilesStacktracesRequest) MarshalToSizedBufferVT(dAtA []byte) (i return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -2831,12 +2811,12 @@ func (m *MergeProfilesStacktracesResult) MarshalToSizedBufferVT(dAtA []byte) (in if len(m.TreeBytes) > 0 { i -= len(m.TreeBytes) copy(dAtA[i:], m.TreeBytes) - i = encodeVarint(dAtA, i, uint64(len(m.TreeBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TreeBytes))) i-- dAtA[i] = 0x22 } if m.Format != 0 { - i = encodeVarint(dAtA, i, uint64(m.Format)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Format)) i-- dAtA[i] = 0x18 } @@ -2844,7 +2824,7 @@ func (m *MergeProfilesStacktracesResult) MarshalToSizedBufferVT(dAtA []byte) (in for iNdEx := len(m.FunctionNames) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.FunctionNames[iNdEx]) copy(dAtA[i:], m.FunctionNames[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.FunctionNames[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.FunctionNames[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -2856,7 +2836,7 @@ func (m *MergeProfilesStacktracesResult) MarshalToSizedBufferVT(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -2900,7 +2880,7 @@ func (m *MergeProfilesStacktracesResponse) MarshalToSizedBufferVT(dAtA []byte) ( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -2910,7 +2890,7 @@ func (m *MergeProfilesStacktracesResponse) MarshalToSizedBufferVT(dAtA []byte) ( return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -2953,7 +2933,7 @@ func (m *SelectSpanProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } @@ -2961,18 +2941,18 @@ func (m *SelectSpanProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int, err for iNdEx := len(m.SpanSelector) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SpanSelector[iNdEx]) copy(dAtA[i:], m.SpanSelector[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.SpanSelector[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SpanSelector[iNdEx]))) i-- dAtA[i] = 0x2a } } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x20 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x18 } @@ -2985,7 +2965,7 @@ func (m *SelectSpanProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Type) if err != nil { @@ -2993,7 +2973,7 @@ func (m *SelectSpanProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int, err } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 @@ -3001,7 +2981,7 @@ func (m *SelectSpanProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int, err if len(m.LabelSelector) > 0 { i -= len(m.LabelSelector) copy(dAtA[i:], m.LabelSelector) - i = encodeVarint(dAtA, i, uint64(len(m.LabelSelector))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LabelSelector))) i-- dAtA[i] = 0xa } @@ -3047,12 +3027,12 @@ func (m *MergeSpanProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int, erro dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.Profiles))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Profiles))) i-- dAtA[i] = 0x1a } if m.MaxNodes != nil { - i = encodeVarint(dAtA, i, uint64(*m.MaxNodes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.MaxNodes)) i-- dAtA[i] = 0x10 } @@ -3062,7 +3042,7 @@ func (m *MergeSpanProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int, erro return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -3105,7 +3085,7 @@ func (m *MergeSpanProfileResponse) MarshalToSizedBufferVT(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -3115,7 +3095,7 @@ func (m *MergeSpanProfileResponse) MarshalToSizedBufferVT(dAtA []byte) (int, err return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -3155,7 +3135,7 @@ func (m *MergeSpanProfileResult) MarshalToSizedBufferVT(dAtA []byte) (int, error if len(m.TreeBytes) > 0 { i -= len(m.TreeBytes) copy(dAtA[i:], m.TreeBytes) - i = encodeVarint(dAtA, i, uint64(len(m.TreeBytes))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TreeBytes))) i-- dAtA[i] = 0xa } @@ -3199,7 +3179,7 @@ func (m *ProfileSets) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -3214,7 +3194,7 @@ func (m *ProfileSets) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.LabelsSets[iNdEx]) if err != nil { @@ -3222,7 +3202,7 @@ func (m *ProfileSets) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0xa @@ -3262,12 +3242,12 @@ func (m *SeriesProfile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.Timestamp != 0 { - i = encodeVarint(dAtA, i, uint64(m.Timestamp)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x10 } if m.LabelIndex != 0 { - i = encodeVarint(dAtA, i, uint64(m.LabelIndex)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LabelIndex)) i-- dAtA[i] = 0x8 } @@ -3311,13 +3291,13 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } } if m.Timestamp != 0 { - i = encodeVarint(dAtA, i, uint64(m.Timestamp)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x20 } @@ -3331,7 +3311,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Labels[iNdEx]) if err != nil { @@ -3339,7 +3319,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x1a @@ -3354,7 +3334,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Type) if err != nil { @@ -3362,7 +3342,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 @@ -3370,7 +3350,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.ID) > 0 { i -= len(m.ID) copy(dAtA[i:], m.ID) - i = encodeVarint(dAtA, i, uint64(len(m.ID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ID))) i-- dAtA[i] = 0xa } @@ -3408,14 +3388,14 @@ func (m *StacktraceSample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.Value != 0 { - i = encodeVarint(dAtA, i, uint64(m.Value)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Value)) i-- dAtA[i] = 0x10 } if len(m.FunctionIds) > 0 { var pksize2 int for _, num := range m.FunctionIds { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -3429,7 +3409,7 @@ func (m *StacktraceSample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0xa } @@ -3475,7 +3455,7 @@ func (m *MergeProfilesLabelsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, e return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.StackTraceSelector) if err != nil { @@ -3483,7 +3463,7 @@ func (m *MergeProfilesLabelsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, e } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x22 @@ -3497,7 +3477,7 @@ func (m *MergeProfilesLabelsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, e dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.Profiles))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Profiles))) i-- dAtA[i] = 0x1a } @@ -3505,7 +3485,7 @@ func (m *MergeProfilesLabelsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, e for iNdEx := len(m.By) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.By[iNdEx]) copy(dAtA[i:], m.By[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.By[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.By[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -3516,7 +3496,7 @@ func (m *MergeProfilesLabelsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, e return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -3563,7 +3543,7 @@ func (m *MergeProfilesLabelsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Series[iNdEx]) if err != nil { @@ -3571,7 +3551,7 @@ func (m *MergeProfilesLabelsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 @@ -3583,7 +3563,7 @@ func (m *MergeProfilesLabelsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -3629,7 +3609,7 @@ func (m *MergeProfilesPprofRequest) MarshalToSizedBufferVT(dAtA []byte) (int, er return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.StackTraceSelector) if err != nil { @@ -3637,13 +3617,13 @@ func (m *MergeProfilesPprofRequest) MarshalToSizedBufferVT(dAtA []byte) (int, er } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x22 } if m.MaxNodes != nil { - i = encodeVarint(dAtA, i, uint64(*m.MaxNodes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.MaxNodes)) i-- dAtA[i] = 0x18 } @@ -3656,7 +3636,7 @@ func (m *MergeProfilesPprofRequest) MarshalToSizedBufferVT(dAtA []byte) (int, er dAtA[i] = 0 } } - i = encodeVarint(dAtA, i, uint64(len(m.Profiles))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Profiles))) i-- dAtA[i] = 0x12 } @@ -3666,7 +3646,7 @@ func (m *MergeProfilesPprofRequest) MarshalToSizedBufferVT(dAtA []byte) (int, er return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -3706,7 +3686,7 @@ func (m *MergeProfilesPprofResponse) MarshalToSizedBufferVT(dAtA []byte) (int, e if len(m.Result) > 0 { i -= len(m.Result) copy(dAtA[i:], m.Result) - i = encodeVarint(dAtA, i, uint64(len(m.Result))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Result))) i-- dAtA[i] = 0x12 } @@ -3716,7 +3696,7 @@ func (m *MergeProfilesPprofResponse) MarshalToSizedBufferVT(dAtA []byte) (int, e return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -3754,12 +3734,12 @@ func (m *BlockMetadataRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) copy(dAtA[i:], m.unknownFields) } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x10 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x8 } @@ -3806,7 +3786,7 @@ func (m *BlockMetadataResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Blocks[iNdEx]) if err != nil { @@ -3814,7 +3794,7 @@ func (m *BlockMetadataResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0xa @@ -3859,7 +3839,7 @@ func (m *Hints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -3910,7 +3890,7 @@ func (m *BlockHints) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Ulids) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Ulids[iNdEx]) copy(dAtA[i:], m.Ulids[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Ulids[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ulids[iNdEx]))) i-- dAtA[i] = 0xa } @@ -3952,7 +3932,7 @@ func (m *GetBlockStatsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) for iNdEx := len(m.Ulids) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Ulids[iNdEx]) copy(dAtA[i:], m.Ulids[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Ulids[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ulids[iNdEx]))) i-- dAtA[i] = 0xa } @@ -3997,7 +3977,7 @@ func (m *GetBlockStatsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -4036,49 +4016,38 @@ func (m *BlockStats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.SymbolBytes != 0 { - i = encodeVarint(dAtA, i, uint64(m.SymbolBytes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SymbolBytes)) i-- dAtA[i] = 0x38 } if m.ProfileBytes != 0 { - i = encodeVarint(dAtA, i, uint64(m.ProfileBytes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProfileBytes)) i-- dAtA[i] = 0x30 } if m.IndexBytes != 0 { - i = encodeVarint(dAtA, i, uint64(m.IndexBytes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.IndexBytes)) i-- dAtA[i] = 0x28 } if m.SampleCount != 0 { - i = encodeVarint(dAtA, i, uint64(m.SampleCount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SampleCount)) i-- dAtA[i] = 0x20 } if m.ProfileCount != 0 { - i = encodeVarint(dAtA, i, uint64(m.ProfileCount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProfileCount)) i-- dAtA[i] = 0x18 } if m.SeriesCount != 0 { - i = encodeVarint(dAtA, i, uint64(m.SeriesCount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SeriesCount)) i-- dAtA[i] = 0x10 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *ProfileTypesRequest) SizeVT() (n int) { if m == nil { return 0 @@ -4086,10 +4055,10 @@ func (m *ProfileTypesRequest) SizeVT() (n int) { var l int _ = l if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } n += len(m.unknownFields) return n @@ -4110,7 +4079,7 @@ func (m *ProfileTypesResponse) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -4126,20 +4095,20 @@ func (m *SeriesRequest) SizeVT() (n int) { if len(m.Matchers) > 0 { for _, s := range m.Matchers { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.LabelNames) > 0 { for _, s := range m.LabelNames { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } n += len(m.unknownFields) return n @@ -4160,7 +4129,7 @@ func (m *SeriesResponse) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -4195,7 +4164,7 @@ func (m *SelectProfilesRequest) SizeVT() (n int) { _ = l l = len(m.LabelSelector) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Type != nil { if size, ok := interface{}(m.Type).(interface { @@ -4205,20 +4174,20 @@ func (m *SelectProfilesRequest) SizeVT() (n int) { } else { l = proto.Size(m.Type) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } if m.Hints != nil { l = m.Hints.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Aggregation != nil { - n += 1 + sov(uint64(*m.Aggregation)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.Aggregation)) } n += len(m.unknownFields) return n @@ -4232,13 +4201,13 @@ func (m *MergeProfilesStacktracesRequest) SizeVT() (n int) { _ = l if m.Request != nil { l = m.Request.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Profiles) > 0 { - n += 1 + sov(uint64(len(m.Profiles))) + len(m.Profiles)*1 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.Profiles))) + len(m.Profiles)*1 } if m.MaxNodes != nil { - n += 1 + sov(uint64(*m.MaxNodes)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.MaxNodes)) } n += len(m.unknownFields) return n @@ -4253,21 +4222,21 @@ func (m *MergeProfilesStacktracesResult) SizeVT() (n int) { if len(m.Stacktraces) > 0 { for _, e := range m.Stacktraces { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.FunctionNames) > 0 { for _, s := range m.FunctionNames { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Format != 0 { - n += 1 + sov(uint64(m.Format)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Format)) } l = len(m.TreeBytes) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -4281,11 +4250,11 @@ func (m *MergeProfilesStacktracesResponse) SizeVT() (n int) { _ = l if m.SelectedProfiles != nil { l = m.SelectedProfiles.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Result != nil { l = m.Result.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -4299,7 +4268,7 @@ func (m *SelectSpanProfileRequest) SizeVT() (n int) { _ = l l = len(m.LabelSelector) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Type != nil { if size, ok := interface{}(m.Type).(interface { @@ -4309,23 +4278,23 @@ func (m *SelectSpanProfileRequest) SizeVT() (n int) { } else { l = proto.Size(m.Type) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } if len(m.SpanSelector) > 0 { for _, s := range m.SpanSelector { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Hints != nil { l = m.Hints.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -4339,13 +4308,13 @@ func (m *MergeSpanProfileRequest) SizeVT() (n int) { _ = l if m.Request != nil { l = m.Request.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.MaxNodes != nil { - n += 1 + sov(uint64(*m.MaxNodes)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.MaxNodes)) } if len(m.Profiles) > 0 { - n += 1 + sov(uint64(len(m.Profiles))) + len(m.Profiles)*1 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.Profiles))) + len(m.Profiles)*1 } n += len(m.unknownFields) return n @@ -4359,11 +4328,11 @@ func (m *MergeSpanProfileResponse) SizeVT() (n int) { _ = l if m.SelectedProfiles != nil { l = m.SelectedProfiles.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Result != nil { l = m.Result.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -4377,7 +4346,7 @@ func (m *MergeSpanProfileResult) SizeVT() (n int) { _ = l l = len(m.TreeBytes) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -4398,13 +4367,13 @@ func (m *ProfileSets) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Profiles) > 0 { for _, e := range m.Profiles { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -4418,10 +4387,10 @@ func (m *SeriesProfile) SizeVT() (n int) { var l int _ = l if m.LabelIndex != 0 { - n += 1 + sov(uint64(m.LabelIndex)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.LabelIndex)) } if m.Timestamp != 0 { - n += 1 + sov(uint64(m.Timestamp)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) } n += len(m.unknownFields) return n @@ -4435,7 +4404,7 @@ func (m *Profile) SizeVT() (n int) { _ = l l = len(m.ID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Type != nil { if size, ok := interface{}(m.Type).(interface { @@ -4445,7 +4414,7 @@ func (m *Profile) SizeVT() (n int) { } else { l = proto.Size(m.Type) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Labels) > 0 { for _, e := range m.Labels { @@ -4456,16 +4425,16 @@ func (m *Profile) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Timestamp != 0 { - n += 1 + sov(uint64(m.Timestamp)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) } if len(m.Stacktraces) > 0 { for _, e := range m.Stacktraces { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -4481,12 +4450,12 @@ func (m *StacktraceSample) SizeVT() (n int) { if len(m.FunctionIds) > 0 { l = 0 for _, e := range m.FunctionIds { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } if m.Value != 0 { - n += 1 + sov(uint64(m.Value)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Value)) } n += len(m.unknownFields) return n @@ -4500,16 +4469,16 @@ func (m *MergeProfilesLabelsRequest) SizeVT() (n int) { _ = l if m.Request != nil { l = m.Request.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.By) > 0 { for _, s := range m.By { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Profiles) > 0 { - n += 1 + sov(uint64(len(m.Profiles))) + len(m.Profiles)*1 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.Profiles))) + len(m.Profiles)*1 } if m.StackTraceSelector != nil { if size, ok := interface{}(m.StackTraceSelector).(interface { @@ -4519,7 +4488,7 @@ func (m *MergeProfilesLabelsRequest) SizeVT() (n int) { } else { l = proto.Size(m.StackTraceSelector) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -4533,7 +4502,7 @@ func (m *MergeProfilesLabelsResponse) SizeVT() (n int) { _ = l if m.SelectedProfiles != nil { l = m.SelectedProfiles.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Series) > 0 { for _, e := range m.Series { @@ -4544,7 +4513,7 @@ func (m *MergeProfilesLabelsResponse) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -4559,13 +4528,13 @@ func (m *MergeProfilesPprofRequest) SizeVT() (n int) { _ = l if m.Request != nil { l = m.Request.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Profiles) > 0 { - n += 1 + sov(uint64(len(m.Profiles))) + len(m.Profiles)*1 + n += 1 + protohelpers.SizeOfVarint(uint64(len(m.Profiles))) + len(m.Profiles)*1 } if m.MaxNodes != nil { - n += 1 + sov(uint64(*m.MaxNodes)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.MaxNodes)) } if m.StackTraceSelector != nil { if size, ok := interface{}(m.StackTraceSelector).(interface { @@ -4575,7 +4544,7 @@ func (m *MergeProfilesPprofRequest) SizeVT() (n int) { } else { l = proto.Size(m.StackTraceSelector) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -4589,11 +4558,11 @@ func (m *MergeProfilesPprofResponse) SizeVT() (n int) { _ = l if m.SelectedProfiles != nil { l = m.SelectedProfiles.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Result) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -4606,10 +4575,10 @@ func (m *BlockMetadataRequest) SizeVT() (n int) { var l int _ = l if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } n += len(m.unknownFields) return n @@ -4630,7 +4599,7 @@ func (m *BlockMetadataResponse) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -4645,7 +4614,7 @@ func (m *Hints) SizeVT() (n int) { _ = l if m.Block != nil { l = m.Block.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -4660,7 +4629,7 @@ func (m *BlockHints) SizeVT() (n int) { if len(m.Ulids) > 0 { for _, s := range m.Ulids { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Deduplication { @@ -4679,7 +4648,7 @@ func (m *GetBlockStatsRequest) SizeVT() (n int) { if len(m.Ulids) > 0 { for _, s := range m.Ulids { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -4695,7 +4664,7 @@ func (m *GetBlockStatsResponse) SizeVT() (n int) { if len(m.BlockStats) > 0 { for _, e := range m.BlockStats { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -4709,33 +4678,27 @@ func (m *BlockStats) SizeVT() (n int) { var l int _ = l if m.SeriesCount != 0 { - n += 1 + sov(uint64(m.SeriesCount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SeriesCount)) } if m.ProfileCount != 0 { - n += 1 + sov(uint64(m.ProfileCount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProfileCount)) } if m.SampleCount != 0 { - n += 1 + sov(uint64(m.SampleCount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SampleCount)) } if m.IndexBytes != 0 { - n += 1 + sov(uint64(m.IndexBytes)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.IndexBytes)) } if m.ProfileBytes != 0 { - n += 1 + sov(uint64(m.ProfileBytes)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProfileBytes)) } if m.SymbolBytes != 0 { - n += 1 + sov(uint64(m.SymbolBytes)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SymbolBytes)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *ProfileTypesRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4744,7 +4707,7 @@ func (m *ProfileTypesRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4772,7 +4735,7 @@ func (m *ProfileTypesRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4791,7 +4754,7 @@ func (m *ProfileTypesRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4805,12 +4768,12 @@ func (m *ProfileTypesRequest) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4833,7 +4796,7 @@ func (m *ProfileTypesResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4861,7 +4824,7 @@ func (m *ProfileTypesResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4874,11 +4837,11 @@ func (m *ProfileTypesResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4898,12 +4861,12 @@ func (m *ProfileTypesResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4926,7 +4889,7 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4954,7 +4917,7 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4968,11 +4931,11 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4986,7 +4949,7 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5000,11 +4963,11 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5018,7 +4981,7 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5037,7 +5000,7 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5051,12 +5014,12 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5079,7 +5042,7 @@ func (m *SeriesResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5107,7 +5070,7 @@ func (m *SeriesResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5120,11 +5083,11 @@ func (m *SeriesResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5144,12 +5107,12 @@ func (m *SeriesResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5172,7 +5135,7 @@ func (m *FlushRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5195,12 +5158,12 @@ func (m *FlushRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5223,7 +5186,7 @@ func (m *FlushResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5246,12 +5209,12 @@ func (m *FlushResponse) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5274,7 +5237,7 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5302,7 +5265,7 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5316,11 +5279,11 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5334,7 +5297,7 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5347,11 +5310,11 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5378,7 +5341,7 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5397,7 +5360,7 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5416,7 +5379,7 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5429,11 +5392,11 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5452,7 +5415,7 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { var v v1.TimeSeriesAggregationType for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5467,12 +5430,12 @@ func (m *SelectProfilesRequest) UnmarshalVT(dAtA []byte) error { m.Aggregation = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5495,7 +5458,7 @@ func (m *MergeProfilesStacktracesRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5523,7 +5486,7 @@ func (m *MergeProfilesStacktracesRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5536,11 +5499,11 @@ func (m *MergeProfilesStacktracesRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5557,7 +5520,7 @@ func (m *MergeProfilesStacktracesRequest) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5574,7 +5537,7 @@ func (m *MergeProfilesStacktracesRequest) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5587,11 +5550,11 @@ func (m *MergeProfilesStacktracesRequest) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5605,7 +5568,7 @@ func (m *MergeProfilesStacktracesRequest) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5629,7 +5592,7 @@ func (m *MergeProfilesStacktracesRequest) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5644,12 +5607,12 @@ func (m *MergeProfilesStacktracesRequest) UnmarshalVT(dAtA []byte) error { m.MaxNodes = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5672,7 +5635,7 @@ func (m *MergeProfilesStacktracesResult) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5700,7 +5663,7 @@ func (m *MergeProfilesStacktracesResult) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5713,11 +5676,11 @@ func (m *MergeProfilesStacktracesResult) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5734,7 +5697,7 @@ func (m *MergeProfilesStacktracesResult) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5748,11 +5711,11 @@ func (m *MergeProfilesStacktracesResult) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5766,7 +5729,7 @@ func (m *MergeProfilesStacktracesResult) UnmarshalVT(dAtA []byte) error { m.Format = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5785,7 +5748,7 @@ func (m *MergeProfilesStacktracesResult) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5798,11 +5761,11 @@ func (m *MergeProfilesStacktracesResult) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5814,12 +5777,12 @@ func (m *MergeProfilesStacktracesResult) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5842,7 +5805,7 @@ func (m *MergeProfilesStacktracesResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5870,7 +5833,7 @@ func (m *MergeProfilesStacktracesResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5883,11 +5846,11 @@ func (m *MergeProfilesStacktracesResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5906,7 +5869,7 @@ func (m *MergeProfilesStacktracesResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5919,11 +5882,11 @@ func (m *MergeProfilesStacktracesResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5937,12 +5900,12 @@ func (m *MergeProfilesStacktracesResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5965,7 +5928,7 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5993,7 +5956,7 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6007,11 +5970,11 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6025,7 +5988,7 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6038,11 +6001,11 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6069,7 +6032,7 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6088,7 +6051,7 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6107,7 +6070,7 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6121,11 +6084,11 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6139,7 +6102,7 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6152,11 +6115,11 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6170,12 +6133,12 @@ func (m *SelectSpanProfileRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6198,7 +6161,7 @@ func (m *MergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6226,7 +6189,7 @@ func (m *MergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6239,11 +6202,11 @@ func (m *MergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6262,7 +6225,7 @@ func (m *MergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6280,7 +6243,7 @@ func (m *MergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6297,7 +6260,7 @@ func (m *MergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6310,11 +6273,11 @@ func (m *MergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6328,7 +6291,7 @@ func (m *MergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6347,12 +6310,12 @@ func (m *MergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6375,7 +6338,7 @@ func (m *MergeSpanProfileResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6403,7 +6366,7 @@ func (m *MergeSpanProfileResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6416,11 +6379,11 @@ func (m *MergeSpanProfileResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6439,7 +6402,7 @@ func (m *MergeSpanProfileResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6452,11 +6415,11 @@ func (m *MergeSpanProfileResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6470,12 +6433,12 @@ func (m *MergeSpanProfileResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6498,7 +6461,7 @@ func (m *MergeSpanProfileResult) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6526,7 +6489,7 @@ func (m *MergeSpanProfileResult) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6539,11 +6502,11 @@ func (m *MergeSpanProfileResult) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6555,12 +6518,12 @@ func (m *MergeSpanProfileResult) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6583,7 +6546,7 @@ func (m *ProfileSets) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6611,7 +6574,7 @@ func (m *ProfileSets) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6624,11 +6587,11 @@ func (m *ProfileSets) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6653,7 +6616,7 @@ func (m *ProfileSets) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6666,11 +6629,11 @@ func (m *ProfileSets) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6682,12 +6645,12 @@ func (m *ProfileSets) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6710,7 +6673,7 @@ func (m *SeriesProfile) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6738,7 +6701,7 @@ func (m *SeriesProfile) UnmarshalVT(dAtA []byte) error { m.LabelIndex = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6757,7 +6720,7 @@ func (m *SeriesProfile) UnmarshalVT(dAtA []byte) error { m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6771,12 +6734,12 @@ func (m *SeriesProfile) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6799,7 +6762,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6827,7 +6790,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6841,11 +6804,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6859,7 +6822,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6872,11 +6835,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6903,7 +6866,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6916,11 +6879,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6945,7 +6908,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6964,7 +6927,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6977,11 +6940,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -6993,12 +6956,12 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7021,7 +6984,7 @@ func (m *StacktraceSample) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7047,7 +7010,7 @@ func (m *StacktraceSample) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7064,7 +7027,7 @@ func (m *StacktraceSample) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7077,11 +7040,11 @@ func (m *StacktraceSample) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7101,7 +7064,7 @@ func (m *StacktraceSample) UnmarshalVT(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7125,7 +7088,7 @@ func (m *StacktraceSample) UnmarshalVT(dAtA []byte) error { m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7139,12 +7102,12 @@ func (m *StacktraceSample) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7167,7 +7130,7 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7195,7 +7158,7 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7208,11 +7171,11 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7231,7 +7194,7 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7245,11 +7208,11 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7261,7 +7224,7 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7278,7 +7241,7 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7291,11 +7254,11 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7309,7 +7272,7 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7333,7 +7296,7 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7346,11 +7309,11 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7372,12 +7335,12 @@ func (m *MergeProfilesLabelsRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7400,7 +7363,7 @@ func (m *MergeProfilesLabelsResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7428,7 +7391,7 @@ func (m *MergeProfilesLabelsResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7441,11 +7404,11 @@ func (m *MergeProfilesLabelsResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7464,7 +7427,7 @@ func (m *MergeProfilesLabelsResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7477,11 +7440,11 @@ func (m *MergeProfilesLabelsResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7501,12 +7464,12 @@ func (m *MergeProfilesLabelsResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7529,7 +7492,7 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7557,7 +7520,7 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7570,11 +7533,11 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7591,7 +7554,7 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7608,7 +7571,7 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7621,11 +7584,11 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7639,7 +7602,7 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7663,7 +7626,7 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7683,7 +7646,7 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7696,11 +7659,11 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7722,12 +7685,12 @@ func (m *MergeProfilesPprofRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7750,7 +7713,7 @@ func (m *MergeProfilesPprofResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7778,7 +7741,7 @@ func (m *MergeProfilesPprofResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7791,11 +7754,11 @@ func (m *MergeProfilesPprofResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7814,7 +7777,7 @@ func (m *MergeProfilesPprofResponse) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7827,11 +7790,11 @@ func (m *MergeProfilesPprofResponse) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -7843,12 +7806,12 @@ func (m *MergeProfilesPprofResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7871,7 +7834,7 @@ func (m *BlockMetadataRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7899,7 +7862,7 @@ func (m *BlockMetadataRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7918,7 +7881,7 @@ func (m *BlockMetadataRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7932,12 +7895,12 @@ func (m *BlockMetadataRequest) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -7960,7 +7923,7 @@ func (m *BlockMetadataResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -7988,7 +7951,7 @@ func (m *BlockMetadataResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8001,11 +7964,11 @@ func (m *BlockMetadataResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8025,12 +7988,12 @@ func (m *BlockMetadataResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8053,7 +8016,7 @@ func (m *Hints) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8081,7 +8044,7 @@ func (m *Hints) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8094,11 +8057,11 @@ func (m *Hints) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8112,12 +8075,12 @@ func (m *Hints) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8140,7 +8103,7 @@ func (m *BlockHints) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8168,7 +8131,7 @@ func (m *BlockHints) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8182,11 +8145,11 @@ func (m *BlockHints) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8200,7 +8163,7 @@ func (m *BlockHints) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8215,12 +8178,12 @@ func (m *BlockHints) UnmarshalVT(dAtA []byte) error { m.Deduplication = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8243,7 +8206,7 @@ func (m *GetBlockStatsRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8271,7 +8234,7 @@ func (m *GetBlockStatsRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8285,11 +8248,11 @@ func (m *GetBlockStatsRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8298,12 +8261,12 @@ func (m *GetBlockStatsRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8326,7 +8289,7 @@ func (m *GetBlockStatsResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8354,7 +8317,7 @@ func (m *GetBlockStatsResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8367,11 +8330,11 @@ func (m *GetBlockStatsResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -8383,12 +8346,12 @@ func (m *GetBlockStatsResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8411,7 +8374,7 @@ func (m *BlockStats) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8439,7 +8402,7 @@ func (m *BlockStats) UnmarshalVT(dAtA []byte) error { m.SeriesCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8458,7 +8421,7 @@ func (m *BlockStats) UnmarshalVT(dAtA []byte) error { m.ProfileCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8477,7 +8440,7 @@ func (m *BlockStats) UnmarshalVT(dAtA []byte) error { m.SampleCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8496,7 +8459,7 @@ func (m *BlockStats) UnmarshalVT(dAtA []byte) error { m.IndexBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8515,7 +8478,7 @@ func (m *BlockStats) UnmarshalVT(dAtA []byte) error { m.ProfileBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8534,7 +8497,7 @@ func (m *BlockStats) UnmarshalVT(dAtA []byte) error { m.SymbolBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -8548,12 +8511,12 @@ func (m *BlockStats) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -8568,88 +8531,3 @@ func (m *BlockStats) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/api/gen/proto/go/push/v1/push.pb.go b/api/gen/proto/go/push/v1/push.pb.go index 5fae5beb2c..997e17464a 100644 --- a/api/gen/proto/go/push/v1/push.pb.go +++ b/api/gen/proto/go/push/v1/push.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: push/v1/push.proto diff --git a/api/gen/proto/go/push/v1/push_vtproto.pb.go b/api/gen/proto/go/push/v1/push_vtproto.pb.go index 640ada3853..0d19001281 100644 --- a/api/gen/proto/go/push/v1/push_vtproto.pb.go +++ b/api/gen/proto/go/push/v1/push_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: push/v1/push.proto package pushv1 @@ -8,13 +8,13 @@ import ( context "context" fmt "fmt" v1 "github.com/grafana/pyroscope/api/gen/proto/go/types/v1" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -28,7 +28,7 @@ func (m *PushResponse) CloneVT() *PushResponse { if m == nil { return (*PushResponse)(nil) } - r := &PushResponse{} + r := new(PushResponse) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -44,7 +44,7 @@ func (m *PushRequest) CloneVT() *PushRequest { if m == nil { return (*PushRequest)(nil) } - r := &PushRequest{} + r := new(PushRequest) if rhs := m.Series; rhs != nil { tmpContainer := make([]*RawProfileSeries, len(rhs)) for k, v := range rhs { @@ -67,7 +67,7 @@ func (m *RawProfileSeries) CloneVT() *RawProfileSeries { if m == nil { return (*RawProfileSeries)(nil) } - r := &RawProfileSeries{} + r := new(RawProfileSeries) if rhs := m.Labels; rhs != nil { tmpContainer := make([]*v1.LabelPair, len(rhs)) for k, v := range rhs { @@ -101,9 +101,8 @@ func (m *RawSample) CloneVT() *RawSample { if m == nil { return (*RawSample)(nil) } - r := &RawSample{ - ID: m.ID, - } + r := new(RawSample) + r.ID = m.ID if rhs := m.RawProfile; rhs != nil { tmpBytes := make([]byte, len(rhs)) copy(tmpBytes, rhs) @@ -407,7 +406,7 @@ func (m *PushRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -452,7 +451,7 @@ func (m *RawProfileSeries) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -467,7 +466,7 @@ func (m *RawProfileSeries) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Labels[iNdEx]) if err != nil { @@ -475,7 +474,7 @@ func (m *RawProfileSeries) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0xa @@ -517,31 +516,20 @@ func (m *RawSample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.ID) > 0 { i -= len(m.ID) copy(dAtA[i:], m.ID) - i = encodeVarint(dAtA, i, uint64(len(m.ID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ID))) i-- dAtA[i] = 0x12 } if len(m.RawProfile) > 0 { i -= len(m.RawProfile) copy(dAtA[i:], m.RawProfile) - i = encodeVarint(dAtA, i, uint64(len(m.RawProfile))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RawProfile))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *PushResponse) SizeVT() (n int) { if m == nil { return 0 @@ -561,7 +549,7 @@ func (m *PushRequest) SizeVT() (n int) { if len(m.Series) > 0 { for _, e := range m.Series { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -583,13 +571,13 @@ func (m *RawProfileSeries) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Samples) > 0 { for _, e := range m.Samples { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -604,22 +592,16 @@ func (m *RawSample) SizeVT() (n int) { _ = l l = len(m.RawProfile) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.ID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *PushResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -628,7 +610,7 @@ func (m *PushResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -651,12 +633,12 @@ func (m *PushResponse) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -679,7 +661,7 @@ func (m *PushRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -707,7 +689,7 @@ func (m *PushRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -720,11 +702,11 @@ func (m *PushRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -736,12 +718,12 @@ func (m *PushRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -764,7 +746,7 @@ func (m *RawProfileSeries) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -792,7 +774,7 @@ func (m *RawProfileSeries) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -805,11 +787,11 @@ func (m *RawProfileSeries) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -834,7 +816,7 @@ func (m *RawProfileSeries) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -847,11 +829,11 @@ func (m *RawProfileSeries) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -863,12 +845,12 @@ func (m *RawProfileSeries) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -891,7 +873,7 @@ func (m *RawSample) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -919,7 +901,7 @@ func (m *RawSample) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -932,11 +914,11 @@ func (m *RawSample) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -953,7 +935,7 @@ func (m *RawSample) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -967,11 +949,11 @@ func (m *RawSample) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -980,12 +962,12 @@ func (m *RawSample) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1000,88 +982,3 @@ func (m *RawSample) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/api/gen/proto/go/querier/v1/querier.pb.go b/api/gen/proto/go/querier/v1/querier.pb.go index e9475ba0de..4951cf9b66 100644 --- a/api/gen/proto/go/querier/v1/querier.pb.go +++ b/api/gen/proto/go/querier/v1/querier.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: querier/v1/querier.proto diff --git a/api/gen/proto/go/querier/v1/querier_vtproto.pb.go b/api/gen/proto/go/querier/v1/querier_vtproto.pb.go index c5fbef6779..af659588c7 100644 --- a/api/gen/proto/go/querier/v1/querier_vtproto.pb.go +++ b/api/gen/proto/go/querier/v1/querier_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: querier/v1/querier.proto package querierv1 @@ -10,6 +10,7 @@ import ( fmt "fmt" v11 "github.com/grafana/pyroscope/api/gen/proto/go/google/v1" v1 "github.com/grafana/pyroscope/api/gen/proto/go/types/v1" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -17,7 +18,6 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" math "math" - bits "math/bits" ) const ( @@ -31,10 +31,9 @@ func (m *ProfileTypesRequest) CloneVT() *ProfileTypesRequest { if m == nil { return (*ProfileTypesRequest)(nil) } - r := &ProfileTypesRequest{ - Start: m.Start, - End: m.End, - } + r := new(ProfileTypesRequest) + r.Start = m.Start + r.End = m.End if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -50,7 +49,7 @@ func (m *ProfileTypesResponse) CloneVT() *ProfileTypesResponse { if m == nil { return (*ProfileTypesResponse)(nil) } - r := &ProfileTypesResponse{} + r := new(ProfileTypesResponse) if rhs := m.ProfileTypes; rhs != nil { tmpContainer := make([]*v1.ProfileType, len(rhs)) for k, v := range rhs { @@ -77,10 +76,9 @@ func (m *SeriesRequest) CloneVT() *SeriesRequest { if m == nil { return (*SeriesRequest)(nil) } - r := &SeriesRequest{ - Start: m.Start, - End: m.End, - } + r := new(SeriesRequest) + r.Start = m.Start + r.End = m.End if rhs := m.Matchers; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -106,7 +104,7 @@ func (m *SeriesResponse) CloneVT() *SeriesResponse { if m == nil { return (*SeriesResponse)(nil) } - r := &SeriesResponse{} + r := new(SeriesResponse) if rhs := m.LabelsSet; rhs != nil { tmpContainer := make([]*v1.Labels, len(rhs)) for k, v := range rhs { @@ -133,12 +131,11 @@ func (m *SelectMergeStacktracesRequest) CloneVT() *SelectMergeStacktracesRequest if m == nil { return (*SelectMergeStacktracesRequest)(nil) } - r := &SelectMergeStacktracesRequest{ - ProfileTypeID: m.ProfileTypeID, - LabelSelector: m.LabelSelector, - Start: m.Start, - End: m.End, - } + r := new(SelectMergeStacktracesRequest) + r.ProfileTypeID = m.ProfileTypeID + r.LabelSelector = m.LabelSelector + r.Start = m.Start + r.End = m.End if rhs := m.MaxNodes; rhs != nil { tmpVal := *rhs r.MaxNodes = &tmpVal @@ -158,9 +155,8 @@ func (m *SelectMergeStacktracesResponse) CloneVT() *SelectMergeStacktracesRespon if m == nil { return (*SelectMergeStacktracesResponse)(nil) } - r := &SelectMergeStacktracesResponse{ - Flamegraph: m.Flamegraph.CloneVT(), - } + r := new(SelectMergeStacktracesResponse) + r.Flamegraph = m.Flamegraph.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -176,12 +172,11 @@ func (m *SelectMergeSpanProfileRequest) CloneVT() *SelectMergeSpanProfileRequest if m == nil { return (*SelectMergeSpanProfileRequest)(nil) } - r := &SelectMergeSpanProfileRequest{ - ProfileTypeID: m.ProfileTypeID, - LabelSelector: m.LabelSelector, - Start: m.Start, - End: m.End, - } + r := new(SelectMergeSpanProfileRequest) + r.ProfileTypeID = m.ProfileTypeID + r.LabelSelector = m.LabelSelector + r.Start = m.Start + r.End = m.End if rhs := m.SpanSelector; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -206,9 +201,8 @@ func (m *SelectMergeSpanProfileResponse) CloneVT() *SelectMergeSpanProfileRespon if m == nil { return (*SelectMergeSpanProfileResponse)(nil) } - r := &SelectMergeSpanProfileResponse{ - Flamegraph: m.Flamegraph.CloneVT(), - } + r := new(SelectMergeSpanProfileResponse) + r.Flamegraph = m.Flamegraph.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -224,10 +218,9 @@ func (m *DiffRequest) CloneVT() *DiffRequest { if m == nil { return (*DiffRequest)(nil) } - r := &DiffRequest{ - Left: m.Left.CloneVT(), - Right: m.Right.CloneVT(), - } + r := new(DiffRequest) + r.Left = m.Left.CloneVT() + r.Right = m.Right.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -243,9 +236,8 @@ func (m *DiffResponse) CloneVT() *DiffResponse { if m == nil { return (*DiffResponse)(nil) } - r := &DiffResponse{ - Flamegraph: m.Flamegraph.CloneVT(), - } + r := new(DiffResponse) + r.Flamegraph = m.Flamegraph.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -261,10 +253,9 @@ func (m *FlameGraph) CloneVT() *FlameGraph { if m == nil { return (*FlameGraph)(nil) } - r := &FlameGraph{ - Total: m.Total, - MaxSelf: m.MaxSelf, - } + r := new(FlameGraph) + r.Total = m.Total + r.MaxSelf = m.MaxSelf if rhs := m.Names; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -292,12 +283,11 @@ func (m *FlameGraphDiff) CloneVT() *FlameGraphDiff { if m == nil { return (*FlameGraphDiff)(nil) } - r := &FlameGraphDiff{ - Total: m.Total, - MaxSelf: m.MaxSelf, - LeftTicks: m.LeftTicks, - RightTicks: m.RightTicks, - } + r := new(FlameGraphDiff) + r.Total = m.Total + r.MaxSelf = m.MaxSelf + r.LeftTicks = m.LeftTicks + r.RightTicks = m.RightTicks if rhs := m.Names; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -325,7 +315,7 @@ func (m *Level) CloneVT() *Level { if m == nil { return (*Level)(nil) } - r := &Level{} + r := new(Level) if rhs := m.Values; rhs != nil { tmpContainer := make([]int64, len(rhs)) copy(tmpContainer, rhs) @@ -346,12 +336,11 @@ func (m *SelectMergeProfileRequest) CloneVT() *SelectMergeProfileRequest { if m == nil { return (*SelectMergeProfileRequest)(nil) } - r := &SelectMergeProfileRequest{ - ProfileTypeID: m.ProfileTypeID, - LabelSelector: m.LabelSelector, - Start: m.Start, - End: m.End, - } + r := new(SelectMergeProfileRequest) + r.ProfileTypeID = m.ProfileTypeID + r.LabelSelector = m.LabelSelector + r.Start = m.Start + r.End = m.End if rhs := m.MaxNodes; rhs != nil { tmpVal := *rhs r.MaxNodes = &tmpVal @@ -378,13 +367,12 @@ func (m *SelectSeriesRequest) CloneVT() *SelectSeriesRequest { if m == nil { return (*SelectSeriesRequest)(nil) } - r := &SelectSeriesRequest{ - ProfileTypeID: m.ProfileTypeID, - LabelSelector: m.LabelSelector, - Start: m.Start, - End: m.End, - Step: m.Step, - } + r := new(SelectSeriesRequest) + r.ProfileTypeID = m.ProfileTypeID + r.LabelSelector = m.LabelSelector + r.Start = m.Start + r.End = m.End + r.Step = m.Step if rhs := m.GroupBy; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -416,7 +404,7 @@ func (m *SelectSeriesResponse) CloneVT() *SelectSeriesResponse { if m == nil { return (*SelectSeriesResponse)(nil) } - r := &SelectSeriesResponse{} + r := new(SelectSeriesResponse) if rhs := m.Series; rhs != nil { tmpContainer := make([]*v1.Series, len(rhs)) for k, v := range rhs { @@ -443,11 +431,10 @@ func (m *AnalyzeQueryRequest) CloneVT() *AnalyzeQueryRequest { if m == nil { return (*AnalyzeQueryRequest)(nil) } - r := &AnalyzeQueryRequest{ - Start: m.Start, - End: m.End, - Query: m.Query, - } + r := new(AnalyzeQueryRequest) + r.Start = m.Start + r.End = m.End + r.Query = m.Query if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -463,9 +450,8 @@ func (m *AnalyzeQueryResponse) CloneVT() *AnalyzeQueryResponse { if m == nil { return (*AnalyzeQueryResponse)(nil) } - r := &AnalyzeQueryResponse{ - QueryImpact: m.QueryImpact.CloneVT(), - } + r := new(AnalyzeQueryResponse) + r.QueryImpact = m.QueryImpact.CloneVT() if rhs := m.QueryScopes; rhs != nil { tmpContainer := make([]*QueryScope, len(rhs)) for k, v := range rhs { @@ -488,17 +474,16 @@ func (m *QueryScope) CloneVT() *QueryScope { if m == nil { return (*QueryScope)(nil) } - r := &QueryScope{ - ComponentType: m.ComponentType, - ComponentCount: m.ComponentCount, - BlockCount: m.BlockCount, - SeriesCount: m.SeriesCount, - ProfileCount: m.ProfileCount, - SampleCount: m.SampleCount, - IndexBytes: m.IndexBytes, - ProfileBytes: m.ProfileBytes, - SymbolBytes: m.SymbolBytes, - } + r := new(QueryScope) + r.ComponentType = m.ComponentType + r.ComponentCount = m.ComponentCount + r.BlockCount = m.BlockCount + r.SeriesCount = m.SeriesCount + r.ProfileCount = m.ProfileCount + r.SampleCount = m.SampleCount + r.IndexBytes = m.IndexBytes + r.ProfileBytes = m.ProfileBytes + r.SymbolBytes = m.SymbolBytes if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -514,11 +499,10 @@ func (m *QueryImpact) CloneVT() *QueryImpact { if m == nil { return (*QueryImpact)(nil) } - r := &QueryImpact{ - TotalBytesInTimeRange: m.TotalBytesInTimeRange, - TotalQueriedSeries: m.TotalQueriedSeries, - DeduplicationNeeded: m.DeduplicationNeeded, - } + r := new(QueryImpact) + r.TotalBytesInTimeRange = m.TotalBytesInTimeRange + r.TotalQueriedSeries = m.TotalQueriedSeries + r.DeduplicationNeeded = m.DeduplicationNeeded if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -1704,12 +1688,12 @@ func (m *ProfileTypesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x10 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x8 } @@ -1756,7 +1740,7 @@ func (m *ProfileTypesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.ProfileTypes[iNdEx]) if err != nil { @@ -1764,7 +1748,7 @@ func (m *ProfileTypesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0xa @@ -1804,12 +1788,12 @@ func (m *SeriesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x20 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x18 } @@ -1817,7 +1801,7 @@ func (m *SeriesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.LabelNames) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.LabelNames[iNdEx]) copy(dAtA[i:], m.LabelNames[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.LabelNames[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LabelNames[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -1826,7 +1810,7 @@ func (m *SeriesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Matchers[iNdEx]) copy(dAtA[i:], m.Matchers[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Matchers[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Matchers[iNdEx]))) i-- dAtA[i] = 0xa } @@ -1874,7 +1858,7 @@ func (m *SeriesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.LabelsSet[iNdEx]) if err != nil { @@ -1882,7 +1866,7 @@ func (m *SeriesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 @@ -1922,31 +1906,31 @@ func (m *SelectMergeStacktracesRequest) MarshalToSizedBufferVT(dAtA []byte) (int copy(dAtA[i:], m.unknownFields) } if m.MaxNodes != nil { - i = encodeVarint(dAtA, i, uint64(*m.MaxNodes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.MaxNodes)) i-- dAtA[i] = 0x28 } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x20 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x18 } if len(m.LabelSelector) > 0 { i -= len(m.LabelSelector) copy(dAtA[i:], m.LabelSelector) - i = encodeVarint(dAtA, i, uint64(len(m.LabelSelector))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LabelSelector))) i-- dAtA[i] = 0x12 } if len(m.ProfileTypeID) > 0 { i -= len(m.ProfileTypeID) copy(dAtA[i:], m.ProfileTypeID) - i = encodeVarint(dAtA, i, uint64(len(m.ProfileTypeID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ProfileTypeID))) i-- dAtA[i] = 0xa } @@ -1989,7 +1973,7 @@ func (m *SelectMergeStacktracesResponse) MarshalToSizedBufferVT(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -2027,17 +2011,17 @@ func (m *SelectMergeSpanProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int copy(dAtA[i:], m.unknownFields) } if m.MaxNodes != nil { - i = encodeVarint(dAtA, i, uint64(*m.MaxNodes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.MaxNodes)) i-- dAtA[i] = 0x30 } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x28 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x20 } @@ -2045,7 +2029,7 @@ func (m *SelectMergeSpanProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int for iNdEx := len(m.SpanSelector) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SpanSelector[iNdEx]) copy(dAtA[i:], m.SpanSelector[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.SpanSelector[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SpanSelector[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -2053,14 +2037,14 @@ func (m *SelectMergeSpanProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int if len(m.LabelSelector) > 0 { i -= len(m.LabelSelector) copy(dAtA[i:], m.LabelSelector) - i = encodeVarint(dAtA, i, uint64(len(m.LabelSelector))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LabelSelector))) i-- dAtA[i] = 0x12 } if len(m.ProfileTypeID) > 0 { i -= len(m.ProfileTypeID) copy(dAtA[i:], m.ProfileTypeID) - i = encodeVarint(dAtA, i, uint64(len(m.ProfileTypeID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ProfileTypeID))) i-- dAtA[i] = 0xa } @@ -2103,7 +2087,7 @@ func (m *SelectMergeSpanProfileResponse) MarshalToSizedBufferVT(dAtA []byte) (in return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -2146,7 +2130,7 @@ func (m *DiffRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -2156,7 +2140,7 @@ func (m *DiffRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -2199,7 +2183,7 @@ func (m *DiffResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -2237,12 +2221,12 @@ func (m *FlameGraph) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.MaxSelf != 0 { - i = encodeVarint(dAtA, i, uint64(m.MaxSelf)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxSelf)) i-- dAtA[i] = 0x20 } if m.Total != 0 { - i = encodeVarint(dAtA, i, uint64(m.Total)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) i-- dAtA[i] = 0x18 } @@ -2253,7 +2237,7 @@ func (m *FlameGraph) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -2262,7 +2246,7 @@ func (m *FlameGraph) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Names[iNdEx]) copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Names[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Names[iNdEx]))) i-- dAtA[i] = 0xa } @@ -2301,22 +2285,22 @@ func (m *FlameGraphDiff) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.RightTicks != 0 { - i = encodeVarint(dAtA, i, uint64(m.RightTicks)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.RightTicks)) i-- dAtA[i] = 0x30 } if m.LeftTicks != 0 { - i = encodeVarint(dAtA, i, uint64(m.LeftTicks)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.LeftTicks)) i-- dAtA[i] = 0x28 } if m.MaxSelf != 0 { - i = encodeVarint(dAtA, i, uint64(m.MaxSelf)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxSelf)) i-- dAtA[i] = 0x20 } if m.Total != 0 { - i = encodeVarint(dAtA, i, uint64(m.Total)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Total)) i-- dAtA[i] = 0x18 } @@ -2327,7 +2311,7 @@ func (m *FlameGraphDiff) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -2336,7 +2320,7 @@ func (m *FlameGraphDiff) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Names[iNdEx]) copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Names[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Names[iNdEx]))) i-- dAtA[i] = 0xa } @@ -2377,7 +2361,7 @@ func (m *Level) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Values) > 0 { var pksize2 int for _, num := range m.Values { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -2391,7 +2375,7 @@ func (m *Level) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0xa } @@ -2437,7 +2421,7 @@ func (m *SelectMergeProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int, er return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.StackTraceSelector) if err != nil { @@ -2445,37 +2429,37 @@ func (m *SelectMergeProfileRequest) MarshalToSizedBufferVT(dAtA []byte) (int, er } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x32 } if m.MaxNodes != nil { - i = encodeVarint(dAtA, i, uint64(*m.MaxNodes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.MaxNodes)) i-- dAtA[i] = 0x28 } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x20 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x18 } if len(m.LabelSelector) > 0 { i -= len(m.LabelSelector) copy(dAtA[i:], m.LabelSelector) - i = encodeVarint(dAtA, i, uint64(len(m.LabelSelector))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LabelSelector))) i-- dAtA[i] = 0x12 } if len(m.ProfileTypeID) > 0 { i -= len(m.ProfileTypeID) copy(dAtA[i:], m.ProfileTypeID) - i = encodeVarint(dAtA, i, uint64(len(m.ProfileTypeID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ProfileTypeID))) i-- dAtA[i] = 0xa } @@ -2521,7 +2505,7 @@ func (m *SelectSeriesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.StackTraceSelector) if err != nil { @@ -2529,13 +2513,13 @@ func (m *SelectSeriesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x42 } if m.Aggregation != nil { - i = encodeVarint(dAtA, i, uint64(*m.Aggregation)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(*m.Aggregation)) i-- dAtA[i] = 0x38 } @@ -2549,32 +2533,32 @@ func (m *SelectSeriesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.GroupBy) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.GroupBy[iNdEx]) copy(dAtA[i:], m.GroupBy[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.GroupBy[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.GroupBy[iNdEx]))) i-- dAtA[i] = 0x2a } } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x20 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x18 } if len(m.LabelSelector) > 0 { i -= len(m.LabelSelector) copy(dAtA[i:], m.LabelSelector) - i = encodeVarint(dAtA, i, uint64(len(m.LabelSelector))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LabelSelector))) i-- dAtA[i] = 0x12 } if len(m.ProfileTypeID) > 0 { i -= len(m.ProfileTypeID) copy(dAtA[i:], m.ProfileTypeID) - i = encodeVarint(dAtA, i, uint64(len(m.ProfileTypeID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ProfileTypeID))) i-- dAtA[i] = 0xa } @@ -2621,7 +2605,7 @@ func (m *SelectSeriesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Series[iNdEx]) if err != nil { @@ -2629,7 +2613,7 @@ func (m *SelectSeriesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0xa @@ -2671,17 +2655,17 @@ func (m *AnalyzeQueryRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Query) > 0 { i -= len(m.Query) copy(dAtA[i:], m.Query) - i = encodeVarint(dAtA, i, uint64(len(m.Query))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Query))) i-- dAtA[i] = 0x22 } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x18 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x10 } @@ -2724,7 +2708,7 @@ func (m *AnalyzeQueryResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -2735,7 +2719,7 @@ func (m *AnalyzeQueryResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -2774,49 +2758,49 @@ func (m *QueryScope) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.SymbolBytes != 0 { - i = encodeVarint(dAtA, i, uint64(m.SymbolBytes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SymbolBytes)) i-- dAtA[i] = 0x48 } if m.ProfileBytes != 0 { - i = encodeVarint(dAtA, i, uint64(m.ProfileBytes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProfileBytes)) i-- dAtA[i] = 0x40 } if m.IndexBytes != 0 { - i = encodeVarint(dAtA, i, uint64(m.IndexBytes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.IndexBytes)) i-- dAtA[i] = 0x38 } if m.SampleCount != 0 { - i = encodeVarint(dAtA, i, uint64(m.SampleCount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SampleCount)) i-- dAtA[i] = 0x30 } if m.ProfileCount != 0 { - i = encodeVarint(dAtA, i, uint64(m.ProfileCount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProfileCount)) i-- dAtA[i] = 0x28 } if m.SeriesCount != 0 { - i = encodeVarint(dAtA, i, uint64(m.SeriesCount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SeriesCount)) i-- dAtA[i] = 0x20 } if m.BlockCount != 0 { - i = encodeVarint(dAtA, i, uint64(m.BlockCount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BlockCount)) i-- dAtA[i] = 0x18 } if m.ComponentCount != 0 { - i = encodeVarint(dAtA, i, uint64(m.ComponentCount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ComponentCount)) i-- dAtA[i] = 0x10 } if len(m.ComponentType) > 0 { i -= len(m.ComponentType) copy(dAtA[i:], m.ComponentType) - i = encodeVarint(dAtA, i, uint64(len(m.ComponentType))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ComponentType))) i-- dAtA[i] = 0xa } @@ -2864,29 +2848,18 @@ func (m *QueryImpact) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x20 } if m.TotalQueriedSeries != 0 { - i = encodeVarint(dAtA, i, uint64(m.TotalQueriedSeries)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalQueriedSeries)) i-- dAtA[i] = 0x18 } if m.TotalBytesInTimeRange != 0 { - i = encodeVarint(dAtA, i, uint64(m.TotalBytesInTimeRange)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TotalBytesInTimeRange)) i-- dAtA[i] = 0x10 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *ProfileTypesRequest) SizeVT() (n int) { if m == nil { return 0 @@ -2894,10 +2867,10 @@ func (m *ProfileTypesRequest) SizeVT() (n int) { var l int _ = l if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } n += len(m.unknownFields) return n @@ -2918,7 +2891,7 @@ func (m *ProfileTypesResponse) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2934,20 +2907,20 @@ func (m *SeriesRequest) SizeVT() (n int) { if len(m.Matchers) > 0 { for _, s := range m.Matchers { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.LabelNames) > 0 { for _, s := range m.LabelNames { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } n += len(m.unknownFields) return n @@ -2968,7 +2941,7 @@ func (m *SeriesResponse) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -2983,20 +2956,20 @@ func (m *SelectMergeStacktracesRequest) SizeVT() (n int) { _ = l l = len(m.ProfileTypeID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.LabelSelector) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } if m.MaxNodes != nil { - n += 1 + sov(uint64(*m.MaxNodes)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.MaxNodes)) } n += len(m.unknownFields) return n @@ -3010,7 +2983,7 @@ func (m *SelectMergeStacktracesResponse) SizeVT() (n int) { _ = l if m.Flamegraph != nil { l = m.Flamegraph.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -3024,26 +2997,26 @@ func (m *SelectMergeSpanProfileRequest) SizeVT() (n int) { _ = l l = len(m.ProfileTypeID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.LabelSelector) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.SpanSelector) > 0 { for _, s := range m.SpanSelector { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } if m.MaxNodes != nil { - n += 1 + sov(uint64(*m.MaxNodes)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.MaxNodes)) } n += len(m.unknownFields) return n @@ -3057,7 +3030,7 @@ func (m *SelectMergeSpanProfileResponse) SizeVT() (n int) { _ = l if m.Flamegraph != nil { l = m.Flamegraph.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -3071,11 +3044,11 @@ func (m *DiffRequest) SizeVT() (n int) { _ = l if m.Left != nil { l = m.Left.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Right != nil { l = m.Right.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -3089,7 +3062,7 @@ func (m *DiffResponse) SizeVT() (n int) { _ = l if m.Flamegraph != nil { l = m.Flamegraph.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -3104,20 +3077,20 @@ func (m *FlameGraph) SizeVT() (n int) { if len(m.Names) > 0 { for _, s := range m.Names { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Levels) > 0 { for _, e := range m.Levels { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Total != 0 { - n += 1 + sov(uint64(m.Total)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Total)) } if m.MaxSelf != 0 { - n += 1 + sov(uint64(m.MaxSelf)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxSelf)) } n += len(m.unknownFields) return n @@ -3132,26 +3105,26 @@ func (m *FlameGraphDiff) SizeVT() (n int) { if len(m.Names) > 0 { for _, s := range m.Names { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Levels) > 0 { for _, e := range m.Levels { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Total != 0 { - n += 1 + sov(uint64(m.Total)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Total)) } if m.MaxSelf != 0 { - n += 1 + sov(uint64(m.MaxSelf)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxSelf)) } if m.LeftTicks != 0 { - n += 1 + sov(uint64(m.LeftTicks)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.LeftTicks)) } if m.RightTicks != 0 { - n += 1 + sov(uint64(m.RightTicks)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.RightTicks)) } n += len(m.unknownFields) return n @@ -3166,9 +3139,9 @@ func (m *Level) SizeVT() (n int) { if len(m.Values) > 0 { l = 0 for _, e := range m.Values { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } n += len(m.unknownFields) return n @@ -3182,20 +3155,20 @@ func (m *SelectMergeProfileRequest) SizeVT() (n int) { _ = l l = len(m.ProfileTypeID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.LabelSelector) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } if m.MaxNodes != nil { - n += 1 + sov(uint64(*m.MaxNodes)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.MaxNodes)) } if m.StackTraceSelector != nil { if size, ok := interface{}(m.StackTraceSelector).(interface { @@ -3205,7 +3178,7 @@ func (m *SelectMergeProfileRequest) SizeVT() (n int) { } else { l = proto.Size(m.StackTraceSelector) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -3219,29 +3192,29 @@ func (m *SelectSeriesRequest) SizeVT() (n int) { _ = l l = len(m.ProfileTypeID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.LabelSelector) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } if len(m.GroupBy) > 0 { for _, s := range m.GroupBy { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Step != 0 { n += 9 } if m.Aggregation != nil { - n += 1 + sov(uint64(*m.Aggregation)) + n += 1 + protohelpers.SizeOfVarint(uint64(*m.Aggregation)) } if m.StackTraceSelector != nil { if size, ok := interface{}(m.StackTraceSelector).(interface { @@ -3251,7 +3224,7 @@ func (m *SelectSeriesRequest) SizeVT() (n int) { } else { l = proto.Size(m.StackTraceSelector) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -3272,7 +3245,7 @@ func (m *SelectSeriesResponse) SizeVT() (n int) { } else { l = proto.Size(e) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -3286,14 +3259,14 @@ func (m *AnalyzeQueryRequest) SizeVT() (n int) { var l int _ = l if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } l = len(m.Query) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -3308,12 +3281,12 @@ func (m *AnalyzeQueryResponse) SizeVT() (n int) { if len(m.QueryScopes) > 0 { for _, e := range m.QueryScopes { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.QueryImpact != nil { l = m.QueryImpact.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -3327,31 +3300,31 @@ func (m *QueryScope) SizeVT() (n int) { _ = l l = len(m.ComponentType) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.ComponentCount != 0 { - n += 1 + sov(uint64(m.ComponentCount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ComponentCount)) } if m.BlockCount != 0 { - n += 1 + sov(uint64(m.BlockCount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.BlockCount)) } if m.SeriesCount != 0 { - n += 1 + sov(uint64(m.SeriesCount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SeriesCount)) } if m.ProfileCount != 0 { - n += 1 + sov(uint64(m.ProfileCount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProfileCount)) } if m.SampleCount != 0 { - n += 1 + sov(uint64(m.SampleCount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SampleCount)) } if m.IndexBytes != 0 { - n += 1 + sov(uint64(m.IndexBytes)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.IndexBytes)) } if m.ProfileBytes != 0 { - n += 1 + sov(uint64(m.ProfileBytes)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProfileBytes)) } if m.SymbolBytes != 0 { - n += 1 + sov(uint64(m.SymbolBytes)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SymbolBytes)) } n += len(m.unknownFields) return n @@ -3364,10 +3337,10 @@ func (m *QueryImpact) SizeVT() (n int) { var l int _ = l if m.TotalBytesInTimeRange != 0 { - n += 1 + sov(uint64(m.TotalBytesInTimeRange)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalBytesInTimeRange)) } if m.TotalQueriedSeries != 0 { - n += 1 + sov(uint64(m.TotalQueriedSeries)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.TotalQueriedSeries)) } if m.DeduplicationNeeded { n += 2 @@ -3376,12 +3349,6 @@ func (m *QueryImpact) SizeVT() (n int) { return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *ProfileTypesRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3390,7 +3357,7 @@ func (m *ProfileTypesRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3418,7 +3385,7 @@ func (m *ProfileTypesRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3437,7 +3404,7 @@ func (m *ProfileTypesRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3451,12 +3418,12 @@ func (m *ProfileTypesRequest) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3479,7 +3446,7 @@ func (m *ProfileTypesResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3507,7 +3474,7 @@ func (m *ProfileTypesResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3520,11 +3487,11 @@ func (m *ProfileTypesResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3544,12 +3511,12 @@ func (m *ProfileTypesResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3572,7 +3539,7 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3600,7 +3567,7 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3614,11 +3581,11 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3632,7 +3599,7 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3646,11 +3613,11 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3664,7 +3631,7 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3683,7 +3650,7 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3697,12 +3664,12 @@ func (m *SeriesRequest) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3725,7 +3692,7 @@ func (m *SeriesResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3753,7 +3720,7 @@ func (m *SeriesResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3766,11 +3733,11 @@ func (m *SeriesResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3790,12 +3757,12 @@ func (m *SeriesResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3818,7 +3785,7 @@ func (m *SelectMergeStacktracesRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3846,7 +3813,7 @@ func (m *SelectMergeStacktracesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3860,11 +3827,11 @@ func (m *SelectMergeStacktracesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3878,7 +3845,7 @@ func (m *SelectMergeStacktracesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3892,11 +3859,11 @@ func (m *SelectMergeStacktracesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3910,7 +3877,7 @@ func (m *SelectMergeStacktracesRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3929,7 +3896,7 @@ func (m *SelectMergeStacktracesRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3948,7 +3915,7 @@ func (m *SelectMergeStacktracesRequest) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3963,12 +3930,12 @@ func (m *SelectMergeStacktracesRequest) UnmarshalVT(dAtA []byte) error { m.MaxNodes = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3991,7 +3958,7 @@ func (m *SelectMergeStacktracesResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4019,7 +3986,7 @@ func (m *SelectMergeStacktracesResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4032,11 +3999,11 @@ func (m *SelectMergeStacktracesResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4050,12 +4017,12 @@ func (m *SelectMergeStacktracesResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4078,7 +4045,7 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4106,7 +4073,7 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4120,11 +4087,11 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4138,7 +4105,7 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4152,11 +4119,11 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4170,7 +4137,7 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4184,11 +4151,11 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4202,7 +4169,7 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4221,7 +4188,7 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4240,7 +4207,7 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4255,12 +4222,12 @@ func (m *SelectMergeSpanProfileRequest) UnmarshalVT(dAtA []byte) error { m.MaxNodes = &v default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4283,7 +4250,7 @@ func (m *SelectMergeSpanProfileResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4311,7 +4278,7 @@ func (m *SelectMergeSpanProfileResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4324,11 +4291,11 @@ func (m *SelectMergeSpanProfileResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4342,12 +4309,12 @@ func (m *SelectMergeSpanProfileResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4370,7 +4337,7 @@ func (m *DiffRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4398,7 +4365,7 @@ func (m *DiffRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4411,11 +4378,11 @@ func (m *DiffRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4434,7 +4401,7 @@ func (m *DiffRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4447,11 +4414,11 @@ func (m *DiffRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4465,12 +4432,12 @@ func (m *DiffRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4493,7 +4460,7 @@ func (m *DiffResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4521,7 +4488,7 @@ func (m *DiffResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4534,11 +4501,11 @@ func (m *DiffResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4552,12 +4519,12 @@ func (m *DiffResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4580,7 +4547,7 @@ func (m *FlameGraph) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4608,7 +4575,7 @@ func (m *FlameGraph) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4622,11 +4589,11 @@ func (m *FlameGraph) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4640,7 +4607,7 @@ func (m *FlameGraph) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4653,11 +4620,11 @@ func (m *FlameGraph) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4674,7 +4641,7 @@ func (m *FlameGraph) UnmarshalVT(dAtA []byte) error { m.Total = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4693,7 +4660,7 @@ func (m *FlameGraph) UnmarshalVT(dAtA []byte) error { m.MaxSelf = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4707,12 +4674,12 @@ func (m *FlameGraph) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4735,7 +4702,7 @@ func (m *FlameGraphDiff) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4763,7 +4730,7 @@ func (m *FlameGraphDiff) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4777,11 +4744,11 @@ func (m *FlameGraphDiff) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4795,7 +4762,7 @@ func (m *FlameGraphDiff) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4808,11 +4775,11 @@ func (m *FlameGraphDiff) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -4829,7 +4796,7 @@ func (m *FlameGraphDiff) UnmarshalVT(dAtA []byte) error { m.Total = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4848,7 +4815,7 @@ func (m *FlameGraphDiff) UnmarshalVT(dAtA []byte) error { m.MaxSelf = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4867,7 +4834,7 @@ func (m *FlameGraphDiff) UnmarshalVT(dAtA []byte) error { m.LeftTicks = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4886,7 +4853,7 @@ func (m *FlameGraphDiff) UnmarshalVT(dAtA []byte) error { m.RightTicks = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4900,12 +4867,12 @@ func (m *FlameGraphDiff) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -4928,7 +4895,7 @@ func (m *Level) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4954,7 +4921,7 @@ func (m *Level) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4971,7 +4938,7 @@ func (m *Level) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -4984,11 +4951,11 @@ func (m *Level) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5008,7 +4975,7 @@ func (m *Level) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5027,12 +4994,12 @@ func (m *Level) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5055,7 +5022,7 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5083,7 +5050,7 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5097,11 +5064,11 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5115,7 +5082,7 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5129,11 +5096,11 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5147,7 +5114,7 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5166,7 +5133,7 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5185,7 +5152,7 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5205,7 +5172,7 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5218,11 +5185,11 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5244,12 +5211,12 @@ func (m *SelectMergeProfileRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5272,7 +5239,7 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5300,7 +5267,7 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5314,11 +5281,11 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5332,7 +5299,7 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5346,11 +5313,11 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5364,7 +5331,7 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5383,7 +5350,7 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5402,7 +5369,7 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5416,11 +5383,11 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5445,7 +5412,7 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { var v v1.TimeSeriesAggregationType for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5465,7 +5432,7 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5478,11 +5445,11 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5504,12 +5471,12 @@ func (m *SelectSeriesRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5532,7 +5499,7 @@ func (m *SelectSeriesResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5560,7 +5527,7 @@ func (m *SelectSeriesResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5573,11 +5540,11 @@ func (m *SelectSeriesResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5597,12 +5564,12 @@ func (m *SelectSeriesResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5625,7 +5592,7 @@ func (m *AnalyzeQueryRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5653,7 +5620,7 @@ func (m *AnalyzeQueryRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5672,7 +5639,7 @@ func (m *AnalyzeQueryRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5691,7 +5658,7 @@ func (m *AnalyzeQueryRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5705,11 +5672,11 @@ func (m *AnalyzeQueryRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5718,12 +5685,12 @@ func (m *AnalyzeQueryRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5746,7 +5713,7 @@ func (m *AnalyzeQueryResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5774,7 +5741,7 @@ func (m *AnalyzeQueryResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5787,11 +5754,11 @@ func (m *AnalyzeQueryResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5808,7 +5775,7 @@ func (m *AnalyzeQueryResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5821,11 +5788,11 @@ func (m *AnalyzeQueryResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5839,12 +5806,12 @@ func (m *AnalyzeQueryResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -5867,7 +5834,7 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5895,7 +5862,7 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5909,11 +5876,11 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -5927,7 +5894,7 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { m.ComponentCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5946,7 +5913,7 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { m.BlockCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5965,7 +5932,7 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { m.SeriesCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -5984,7 +5951,7 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { m.ProfileCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6003,7 +5970,7 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { m.SampleCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6022,7 +5989,7 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { m.IndexBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6041,7 +6008,7 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { m.ProfileBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6060,7 +6027,7 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { m.SymbolBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6074,12 +6041,12 @@ func (m *QueryScope) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6102,7 +6069,7 @@ func (m *QueryImpact) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6130,7 +6097,7 @@ func (m *QueryImpact) UnmarshalVT(dAtA []byte) error { m.TotalBytesInTimeRange = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6149,7 +6116,7 @@ func (m *QueryImpact) UnmarshalVT(dAtA []byte) error { m.TotalQueriedSeries = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6168,7 +6135,7 @@ func (m *QueryImpact) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -6183,12 +6150,12 @@ func (m *QueryImpact) UnmarshalVT(dAtA []byte) error { m.DeduplicationNeeded = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -6203,88 +6170,3 @@ func (m *QueryImpact) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/api/gen/proto/go/settings/v1/setting.pb.go b/api/gen/proto/go/settings/v1/setting.pb.go index 306f6a557a..fe25258daf 100644 --- a/api/gen/proto/go/settings/v1/setting.pb.go +++ b/api/gen/proto/go/settings/v1/setting.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: settings/v1/setting.proto diff --git a/api/gen/proto/go/settings/v1/setting_vtproto.pb.go b/api/gen/proto/go/settings/v1/setting_vtproto.pb.go index cfc147fa15..ce4853fd6b 100644 --- a/api/gen/proto/go/settings/v1/setting_vtproto.pb.go +++ b/api/gen/proto/go/settings/v1/setting_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: settings/v1/setting.proto package settingsv1 @@ -7,13 +7,13 @@ package settingsv1 import ( context "context" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -27,7 +27,7 @@ func (m *GetSettingsRequest) CloneVT() *GetSettingsRequest { if m == nil { return (*GetSettingsRequest)(nil) } - r := &GetSettingsRequest{} + r := new(GetSettingsRequest) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -43,7 +43,7 @@ func (m *GetSettingsResponse) CloneVT() *GetSettingsResponse { if m == nil { return (*GetSettingsResponse)(nil) } - r := &GetSettingsResponse{} + r := new(GetSettingsResponse) if rhs := m.Settings; rhs != nil { tmpContainer := make([]*Setting, len(rhs)) for k, v := range rhs { @@ -66,9 +66,8 @@ func (m *SetSettingsRequest) CloneVT() *SetSettingsRequest { if m == nil { return (*SetSettingsRequest)(nil) } - r := &SetSettingsRequest{ - Setting: m.Setting.CloneVT(), - } + r := new(SetSettingsRequest) + r.Setting = m.Setting.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -84,9 +83,8 @@ func (m *SetSettingsResponse) CloneVT() *SetSettingsResponse { if m == nil { return (*SetSettingsResponse)(nil) } - r := &SetSettingsResponse{ - Setting: m.Setting.CloneVT(), - } + r := new(SetSettingsResponse) + r.Setting = m.Setting.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -102,11 +100,10 @@ func (m *Setting) CloneVT() *Setting { if m == nil { return (*Setting)(nil) } - r := &Setting{ - Name: m.Name, - Value: m.Value, - ModifiedAt: m.ModifiedAt, - } + r := new(Setting) + r.Name = m.Name + r.Value = m.Value + r.ModifiedAt = m.ModifiedAt if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -428,7 +425,7 @@ func (m *GetSettingsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -472,7 +469,7 @@ func (m *SetSettingsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -515,7 +512,7 @@ func (m *SetSettingsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -553,38 +550,27 @@ func (m *Setting) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.ModifiedAt != 0 { - i = encodeVarint(dAtA, i, uint64(m.ModifiedAt)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ModifiedAt)) i-- dAtA[i] = 0x18 } if len(m.Value) > 0 { i -= len(m.Value) copy(dAtA[i:], m.Value) - i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0x12 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *GetSettingsRequest) SizeVT() (n int) { if m == nil { return 0 @@ -604,7 +590,7 @@ func (m *GetSettingsResponse) SizeVT() (n int) { if len(m.Settings) > 0 { for _, e := range m.Settings { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -619,7 +605,7 @@ func (m *SetSettingsRequest) SizeVT() (n int) { _ = l if m.Setting != nil { l = m.Setting.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -633,7 +619,7 @@ func (m *SetSettingsResponse) SizeVT() (n int) { _ = l if m.Setting != nil { l = m.Setting.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -647,25 +633,19 @@ func (m *Setting) SizeVT() (n int) { _ = l l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Value) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.ModifiedAt != 0 { - n += 1 + sov(uint64(m.ModifiedAt)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ModifiedAt)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *GetSettingsRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -674,7 +654,7 @@ func (m *GetSettingsRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -697,12 +677,12 @@ func (m *GetSettingsRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -725,7 +705,7 @@ func (m *GetSettingsResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -753,7 +733,7 @@ func (m *GetSettingsResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -766,11 +746,11 @@ func (m *GetSettingsResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -782,12 +762,12 @@ func (m *GetSettingsResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -810,7 +790,7 @@ func (m *SetSettingsRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -838,7 +818,7 @@ func (m *SetSettingsRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -851,11 +831,11 @@ func (m *SetSettingsRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -869,12 +849,12 @@ func (m *SetSettingsRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -897,7 +877,7 @@ func (m *SetSettingsResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -925,7 +905,7 @@ func (m *SetSettingsResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -938,11 +918,11 @@ func (m *SetSettingsResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -956,12 +936,12 @@ func (m *SetSettingsResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -984,7 +964,7 @@ func (m *Setting) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1012,7 +992,7 @@ func (m *Setting) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1026,11 +1006,11 @@ func (m *Setting) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1044,7 +1024,7 @@ func (m *Setting) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1058,11 +1038,11 @@ func (m *Setting) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1076,7 +1056,7 @@ func (m *Setting) UnmarshalVT(dAtA []byte) error { m.ModifiedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1090,12 +1070,12 @@ func (m *Setting) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1110,88 +1090,3 @@ func (m *Setting) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/api/gen/proto/go/status/v1/status.pb.go b/api/gen/proto/go/status/v1/status.pb.go index a3e0977346..dbf3e21ef2 100644 --- a/api/gen/proto/go/status/v1/status.pb.go +++ b/api/gen/proto/go/status/v1/status.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: status/v1/status.proto diff --git a/api/gen/proto/go/status/v1/status_vtproto.pb.go b/api/gen/proto/go/status/v1/status_vtproto.pb.go index 32d17d7e1b..5803cc1e22 100644 --- a/api/gen/proto/go/status/v1/status_vtproto.pb.go +++ b/api/gen/proto/go/status/v1/status_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: status/v1/status.proto package statusv1 @@ -7,6 +7,7 @@ package statusv1 import ( context "context" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" httpbody "google.golang.org/genproto/googleapis/api/httpbody" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -14,7 +15,6 @@ import ( proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -28,7 +28,7 @@ func (m *GetBuildInfoRequest) CloneVT() *GetBuildInfoRequest { if m == nil { return (*GetBuildInfoRequest)(nil) } - r := &GetBuildInfoRequest{} + r := new(GetBuildInfoRequest) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -44,10 +44,9 @@ func (m *GetBuildInfoResponse) CloneVT() *GetBuildInfoResponse { if m == nil { return (*GetBuildInfoResponse)(nil) } - r := &GetBuildInfoResponse{ - Status: m.Status, - Data: m.Data.CloneVT(), - } + r := new(GetBuildInfoResponse) + r.Status = m.Status + r.Data = m.Data.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -63,14 +62,13 @@ func (m *GetBuildInfoData) CloneVT() *GetBuildInfoData { if m == nil { return (*GetBuildInfoData)(nil) } - r := &GetBuildInfoData{ - Version: m.Version, - Revision: m.Revision, - Branch: m.Branch, - BuildUser: m.BuildUser, - BuildDate: m.BuildDate, - GoVersion: m.GoVersion, - } + r := new(GetBuildInfoData) + r.Version = m.Version + r.Revision = m.Revision + r.Branch = m.Branch + r.BuildUser = m.BuildUser + r.BuildDate = m.BuildDate + r.GoVersion = m.GoVersion if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -86,7 +84,7 @@ func (m *GetConfigRequest) CloneVT() *GetConfigRequest { if m == nil { return (*GetConfigRequest)(nil) } - r := &GetConfigRequest{} + r := new(GetConfigRequest) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -102,7 +100,7 @@ func (m *GetConfigResponse) CloneVT() *GetConfigResponse { if m == nil { return (*GetConfigResponse)(nil) } - r := &GetConfigResponse{} + r := new(GetConfigResponse) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -493,14 +491,14 @@ func (m *GetBuildInfoResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } if len(m.Status) > 0 { i -= len(m.Status) copy(dAtA[i:], m.Status) - i = encodeVarint(dAtA, i, uint64(len(m.Status))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Status))) i-- dAtA[i] = 0xa } @@ -540,42 +538,42 @@ func (m *GetBuildInfoData) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.GoVersion) > 0 { i -= len(m.GoVersion) copy(dAtA[i:], m.GoVersion) - i = encodeVarint(dAtA, i, uint64(len(m.GoVersion))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.GoVersion))) i-- dAtA[i] = 0x32 } if len(m.BuildDate) > 0 { i -= len(m.BuildDate) copy(dAtA[i:], m.BuildDate) - i = encodeVarint(dAtA, i, uint64(len(m.BuildDate))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.BuildDate))) i-- dAtA[i] = 0x2a } if len(m.BuildUser) > 0 { i -= len(m.BuildUser) copy(dAtA[i:], m.BuildUser) - i = encodeVarint(dAtA, i, uint64(len(m.BuildUser))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.BuildUser))) i-- dAtA[i] = 0x22 } if len(m.Branch) > 0 { i -= len(m.Branch) copy(dAtA[i:], m.Branch) - i = encodeVarint(dAtA, i, uint64(len(m.Branch))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Branch))) i-- dAtA[i] = 0x1a } if len(m.Revision) > 0 { i -= len(m.Revision) copy(dAtA[i:], m.Revision) - i = encodeVarint(dAtA, i, uint64(len(m.Revision))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Revision))) i-- dAtA[i] = 0x12 } if len(m.Version) > 0 { i -= len(m.Version) copy(dAtA[i:], m.Version) - i = encodeVarint(dAtA, i, uint64(len(m.Version))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Version))) i-- dAtA[i] = 0xa } @@ -648,17 +646,6 @@ func (m *GetConfigResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *GetBuildInfoRequest) SizeVT() (n int) { if m == nil { return 0 @@ -677,11 +664,11 @@ func (m *GetBuildInfoResponse) SizeVT() (n int) { _ = l l = len(m.Status) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Data != nil { l = m.Data.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -695,27 +682,27 @@ func (m *GetBuildInfoData) SizeVT() (n int) { _ = l l = len(m.Version) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Revision) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Branch) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.BuildUser) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.BuildDate) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.GoVersion) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -741,12 +728,6 @@ func (m *GetConfigResponse) SizeVT() (n int) { return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *GetBuildInfoRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -755,7 +736,7 @@ func (m *GetBuildInfoRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -778,12 +759,12 @@ func (m *GetBuildInfoRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -806,7 +787,7 @@ func (m *GetBuildInfoResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -834,7 +815,7 @@ func (m *GetBuildInfoResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -848,11 +829,11 @@ func (m *GetBuildInfoResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -866,7 +847,7 @@ func (m *GetBuildInfoResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -879,11 +860,11 @@ func (m *GetBuildInfoResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -897,12 +878,12 @@ func (m *GetBuildInfoResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -925,7 +906,7 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -953,7 +934,7 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -967,11 +948,11 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -985,7 +966,7 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -999,11 +980,11 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1017,7 +998,7 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1031,11 +1012,11 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1049,7 +1030,7 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1063,11 +1044,11 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1081,7 +1062,7 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1095,11 +1076,11 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1113,7 +1094,7 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1127,11 +1108,11 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1140,12 +1121,12 @@ func (m *GetBuildInfoData) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1168,7 +1149,7 @@ func (m *GetConfigRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1191,12 +1172,12 @@ func (m *GetConfigRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1219,7 +1200,7 @@ func (m *GetConfigResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1242,12 +1223,12 @@ func (m *GetConfigResponse) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1262,88 +1243,3 @@ func (m *GetConfigResponse) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/api/gen/proto/go/storegateway/v1/storegateway.pb.go b/api/gen/proto/go/storegateway/v1/storegateway.pb.go index a71ded2c3e..9248db42b9 100644 --- a/api/gen/proto/go/storegateway/v1/storegateway.pb.go +++ b/api/gen/proto/go/storegateway/v1/storegateway.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: storegateway/v1/storegateway.proto diff --git a/api/gen/proto/go/storegateway/v1/storegateway_vtproto.pb.go b/api/gen/proto/go/storegateway/v1/storegateway_vtproto.pb.go index d17dbbb283..31230fc528 100644 --- a/api/gen/proto/go/storegateway/v1/storegateway_vtproto.pb.go +++ b/api/gen/proto/go/storegateway/v1/storegateway_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: storegateway/v1/storegateway.proto package storegatewayv1 diff --git a/api/gen/proto/go/types/v1/types.pb.go b/api/gen/proto/go/types/v1/types.pb.go index 31ea12b556..fdf11d8222 100644 --- a/api/gen/proto/go/types/v1/types.pb.go +++ b/api/gen/proto/go/types/v1/types.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: types/v1/types.proto diff --git a/api/gen/proto/go/types/v1/types_vtproto.pb.go b/api/gen/proto/go/types/v1/types_vtproto.pb.go index b2ce869a6a..6d0a40477d 100644 --- a/api/gen/proto/go/types/v1/types_vtproto.pb.go +++ b/api/gen/proto/go/types/v1/types_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: types/v1/types.proto package typesv1 @@ -7,11 +7,11 @@ package typesv1 import ( binary "encoding/binary" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" math "math" - bits "math/bits" ) const ( @@ -25,10 +25,9 @@ func (m *LabelPair) CloneVT() *LabelPair { if m == nil { return (*LabelPair)(nil) } - r := &LabelPair{ - Name: m.Name, - Value: m.Value, - } + r := new(LabelPair) + r.Name = m.Name + r.Value = m.Value if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -44,14 +43,13 @@ func (m *ProfileType) CloneVT() *ProfileType { if m == nil { return (*ProfileType)(nil) } - r := &ProfileType{ - ID: m.ID, - Name: m.Name, - SampleType: m.SampleType, - SampleUnit: m.SampleUnit, - PeriodType: m.PeriodType, - PeriodUnit: m.PeriodUnit, - } + r := new(ProfileType) + r.ID = m.ID + r.Name = m.Name + r.SampleType = m.SampleType + r.SampleUnit = m.SampleUnit + r.PeriodType = m.PeriodType + r.PeriodUnit = m.PeriodUnit if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -67,7 +65,7 @@ func (m *Labels) CloneVT() *Labels { if m == nil { return (*Labels)(nil) } - r := &Labels{} + r := new(Labels) if rhs := m.Labels; rhs != nil { tmpContainer := make([]*LabelPair, len(rhs)) for k, v := range rhs { @@ -90,7 +88,7 @@ func (m *Series) CloneVT() *Series { if m == nil { return (*Series)(nil) } - r := &Series{} + r := new(Series) if rhs := m.Labels; rhs != nil { tmpContainer := make([]*LabelPair, len(rhs)) for k, v := range rhs { @@ -120,10 +118,9 @@ func (m *Point) CloneVT() *Point { if m == nil { return (*Point)(nil) } - r := &Point{ - Value: m.Value, - Timestamp: m.Timestamp, - } + r := new(Point) + r.Value = m.Value + r.Timestamp = m.Timestamp if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -139,11 +136,10 @@ func (m *LabelValuesRequest) CloneVT() *LabelValuesRequest { if m == nil { return (*LabelValuesRequest)(nil) } - r := &LabelValuesRequest{ - Name: m.Name, - Start: m.Start, - End: m.End, - } + r := new(LabelValuesRequest) + r.Name = m.Name + r.Start = m.Start + r.End = m.End if rhs := m.Matchers; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -164,7 +160,7 @@ func (m *LabelValuesResponse) CloneVT() *LabelValuesResponse { if m == nil { return (*LabelValuesResponse)(nil) } - r := &LabelValuesResponse{} + r := new(LabelValuesResponse) if rhs := m.Names; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -185,10 +181,9 @@ func (m *LabelNamesRequest) CloneVT() *LabelNamesRequest { if m == nil { return (*LabelNamesRequest)(nil) } - r := &LabelNamesRequest{ - Start: m.Start, - End: m.End, - } + r := new(LabelNamesRequest) + r.Start = m.Start + r.End = m.End if rhs := m.Matchers; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -209,7 +204,7 @@ func (m *LabelNamesResponse) CloneVT() *LabelNamesResponse { if m == nil { return (*LabelNamesResponse)(nil) } - r := &LabelNamesResponse{} + r := new(LabelNamesResponse) if rhs := m.Names; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -230,12 +225,11 @@ func (m *BlockInfo) CloneVT() *BlockInfo { if m == nil { return (*BlockInfo)(nil) } - r := &BlockInfo{ - Ulid: m.Ulid, - MinTime: m.MinTime, - MaxTime: m.MaxTime, - Compaction: m.Compaction.CloneVT(), - } + r := new(BlockInfo) + r.Ulid = m.Ulid + r.MinTime = m.MinTime + r.MaxTime = m.MaxTime + r.Compaction = m.Compaction.CloneVT() if rhs := m.Labels; rhs != nil { tmpContainer := make([]*LabelPair, len(rhs)) for k, v := range rhs { @@ -258,9 +252,8 @@ func (m *BlockCompaction) CloneVT() *BlockCompaction { if m == nil { return (*BlockCompaction)(nil) } - r := &BlockCompaction{ - Level: m.Level, - } + r := new(BlockCompaction) + r.Level = m.Level if rhs := m.Sources; rhs != nil { tmpContainer := make([]string, len(rhs)) copy(tmpContainer, rhs) @@ -286,7 +279,7 @@ func (m *StackTraceSelector) CloneVT() *StackTraceSelector { if m == nil { return (*StackTraceSelector)(nil) } - r := &StackTraceSelector{} + r := new(StackTraceSelector) if rhs := m.CallSite; rhs != nil { tmpContainer := make([]*Location, len(rhs)) for k, v := range rhs { @@ -309,9 +302,8 @@ func (m *Location) CloneVT() *Location { if m == nil { return (*Location)(nil) } - r := &Location{ - Name: m.Name, - } + r := new(Location) + r.Name = m.Name if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -327,7 +319,7 @@ func (m *GetProfileStatsRequest) CloneVT() *GetProfileStatsRequest { if m == nil { return (*GetProfileStatsRequest)(nil) } - r := &GetProfileStatsRequest{} + r := new(GetProfileStatsRequest) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -343,11 +335,10 @@ func (m *GetProfileStatsResponse) CloneVT() *GetProfileStatsResponse { if m == nil { return (*GetProfileStatsResponse)(nil) } - r := &GetProfileStatsResponse{ - DataIngested: m.DataIngested, - OldestProfileTime: m.OldestProfileTime, - NewestProfileTime: m.NewestProfileTime, - } + r := new(GetProfileStatsResponse) + r.DataIngested = m.DataIngested + r.OldestProfileTime = m.OldestProfileTime + r.NewestProfileTime = m.NewestProfileTime if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -843,14 +834,14 @@ func (m *LabelPair) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Value) > 0 { i -= len(m.Value) copy(dAtA[i:], m.Value) - i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0x12 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } @@ -890,42 +881,42 @@ func (m *ProfileType) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.PeriodUnit) > 0 { i -= len(m.PeriodUnit) copy(dAtA[i:], m.PeriodUnit) - i = encodeVarint(dAtA, i, uint64(len(m.PeriodUnit))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PeriodUnit))) i-- dAtA[i] = 0x3a } if len(m.PeriodType) > 0 { i -= len(m.PeriodType) copy(dAtA[i:], m.PeriodType) - i = encodeVarint(dAtA, i, uint64(len(m.PeriodType))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PeriodType))) i-- dAtA[i] = 0x32 } if len(m.SampleUnit) > 0 { i -= len(m.SampleUnit) copy(dAtA[i:], m.SampleUnit) - i = encodeVarint(dAtA, i, uint64(len(m.SampleUnit))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SampleUnit))) i-- dAtA[i] = 0x2a } if len(m.SampleType) > 0 { i -= len(m.SampleType) copy(dAtA[i:], m.SampleType) - i = encodeVarint(dAtA, i, uint64(len(m.SampleType))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SampleType))) i-- dAtA[i] = 0x22 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.ID) > 0 { i -= len(m.ID) copy(dAtA[i:], m.ID) - i = encodeVarint(dAtA, i, uint64(len(m.ID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ID))) i-- dAtA[i] = 0xa } @@ -969,7 +960,7 @@ func (m *Labels) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1014,7 +1005,7 @@ func (m *Series) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -1026,7 +1017,7 @@ func (m *Series) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1065,7 +1056,7 @@ func (m *Point) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.Timestamp != 0 { - i = encodeVarint(dAtA, i, uint64(m.Timestamp)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x10 } @@ -1109,12 +1100,12 @@ func (m *LabelValuesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x20 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x18 } @@ -1122,7 +1113,7 @@ func (m *LabelValuesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Matchers[iNdEx]) copy(dAtA[i:], m.Matchers[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Matchers[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Matchers[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -1130,7 +1121,7 @@ func (m *LabelValuesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } @@ -1171,7 +1162,7 @@ func (m *LabelValuesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Names[iNdEx]) copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Names[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Names[iNdEx]))) i-- dAtA[i] = 0xa } @@ -1210,12 +1201,12 @@ func (m *LabelNamesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.End != 0 { - i = encodeVarint(dAtA, i, uint64(m.End)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.End)) i-- dAtA[i] = 0x18 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x10 } @@ -1223,7 +1214,7 @@ func (m *LabelNamesRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Matchers[iNdEx]) copy(dAtA[i:], m.Matchers[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Matchers[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Matchers[iNdEx]))) i-- dAtA[i] = 0xa } @@ -1265,7 +1256,7 @@ func (m *LabelNamesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Names[iNdEx]) copy(dAtA[i:], m.Names[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Names[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Names[iNdEx]))) i-- dAtA[i] = 0xa } @@ -1310,7 +1301,7 @@ func (m *BlockInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -1321,24 +1312,24 @@ func (m *BlockInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } if m.MaxTime != 0 { - i = encodeVarint(dAtA, i, uint64(m.MaxTime)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MaxTime)) i-- dAtA[i] = 0x18 } if m.MinTime != 0 { - i = encodeVarint(dAtA, i, uint64(m.MinTime)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MinTime)) i-- dAtA[i] = 0x10 } if len(m.Ulid) > 0 { i -= len(m.Ulid) copy(dAtA[i:], m.Ulid) - i = encodeVarint(dAtA, i, uint64(len(m.Ulid))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ulid))) i-- dAtA[i] = 0xa } @@ -1379,7 +1370,7 @@ func (m *BlockCompaction) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Parents) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Parents[iNdEx]) copy(dAtA[i:], m.Parents[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Parents[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Parents[iNdEx]))) i-- dAtA[i] = 0x1a } @@ -1388,13 +1379,13 @@ func (m *BlockCompaction) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Sources) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Sources[iNdEx]) copy(dAtA[i:], m.Sources[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Sources[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Sources[iNdEx]))) i-- dAtA[i] = 0x12 } } if m.Level != 0 { - i = encodeVarint(dAtA, i, uint64(m.Level)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Level)) i-- dAtA[i] = 0x8 } @@ -1438,7 +1429,7 @@ func (m *StackTraceSelector) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -1479,7 +1470,7 @@ func (m *Location) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } @@ -1550,12 +1541,12 @@ func (m *GetProfileStatsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, erro copy(dAtA[i:], m.unknownFields) } if m.NewestProfileTime != 0 { - i = encodeVarint(dAtA, i, uint64(m.NewestProfileTime)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NewestProfileTime)) i-- dAtA[i] = 0x18 } if m.OldestProfileTime != 0 { - i = encodeVarint(dAtA, i, uint64(m.OldestProfileTime)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.OldestProfileTime)) i-- dAtA[i] = 0x10 } @@ -1572,17 +1563,6 @@ func (m *GetProfileStatsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *LabelPair) SizeVT() (n int) { if m == nil { return 0 @@ -1591,11 +1571,11 @@ func (m *LabelPair) SizeVT() (n int) { _ = l l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Value) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1609,27 +1589,27 @@ func (m *ProfileType) SizeVT() (n int) { _ = l l = len(m.ID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.SampleType) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.SampleUnit) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.PeriodType) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.PeriodUnit) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1644,7 +1624,7 @@ func (m *Labels) SizeVT() (n int) { if len(m.Labels) > 0 { for _, e := range m.Labels { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1660,13 +1640,13 @@ func (m *Series) SizeVT() (n int) { if len(m.Labels) > 0 { for _, e := range m.Labels { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Points) > 0 { for _, e := range m.Points { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1683,7 +1663,7 @@ func (m *Point) SizeVT() (n int) { n += 9 } if m.Timestamp != 0 { - n += 1 + sov(uint64(m.Timestamp)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) } n += len(m.unknownFields) return n @@ -1697,19 +1677,19 @@ func (m *LabelValuesRequest) SizeVT() (n int) { _ = l l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Matchers) > 0 { for _, s := range m.Matchers { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } n += len(m.unknownFields) return n @@ -1724,7 +1704,7 @@ func (m *LabelValuesResponse) SizeVT() (n int) { if len(m.Names) > 0 { for _, s := range m.Names { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1740,14 +1720,14 @@ func (m *LabelNamesRequest) SizeVT() (n int) { if len(m.Matchers) > 0 { for _, s := range m.Matchers { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.End != 0 { - n += 1 + sov(uint64(m.End)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.End)) } n += len(m.unknownFields) return n @@ -1762,7 +1742,7 @@ func (m *LabelNamesResponse) SizeVT() (n int) { if len(m.Names) > 0 { for _, s := range m.Names { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1777,22 +1757,22 @@ func (m *BlockInfo) SizeVT() (n int) { _ = l l = len(m.Ulid) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.MinTime != 0 { - n += 1 + sov(uint64(m.MinTime)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MinTime)) } if m.MaxTime != 0 { - n += 1 + sov(uint64(m.MaxTime)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MaxTime)) } if m.Compaction != nil { l = m.Compaction.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Labels) > 0 { for _, e := range m.Labels { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1806,18 +1786,18 @@ func (m *BlockCompaction) SizeVT() (n int) { var l int _ = l if m.Level != 0 { - n += 1 + sov(uint64(m.Level)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Level)) } if len(m.Sources) > 0 { for _, s := range m.Sources { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Parents) > 0 { for _, s := range m.Parents { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1833,7 +1813,7 @@ func (m *StackTraceSelector) SizeVT() (n int) { if len(m.CallSite) > 0 { for _, e := range m.CallSite { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -1848,7 +1828,7 @@ func (m *Location) SizeVT() (n int) { _ = l l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1874,21 +1854,15 @@ func (m *GetProfileStatsResponse) SizeVT() (n int) { n += 2 } if m.OldestProfileTime != 0 { - n += 1 + sov(uint64(m.OldestProfileTime)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.OldestProfileTime)) } if m.NewestProfileTime != 0 { - n += 1 + sov(uint64(m.NewestProfileTime)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.NewestProfileTime)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *LabelPair) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1897,7 +1871,7 @@ func (m *LabelPair) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1925,7 +1899,7 @@ func (m *LabelPair) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1939,11 +1913,11 @@ func (m *LabelPair) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1957,7 +1931,7 @@ func (m *LabelPair) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1971,11 +1945,11 @@ func (m *LabelPair) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1984,12 +1958,12 @@ func (m *LabelPair) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2012,7 +1986,7 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2040,7 +2014,7 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2054,11 +2028,11 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2072,7 +2046,7 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2086,11 +2060,11 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2104,7 +2078,7 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2118,11 +2092,11 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2136,7 +2110,7 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2150,11 +2124,11 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2168,7 +2142,7 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2182,11 +2156,11 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2200,7 +2174,7 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2214,11 +2188,11 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2227,12 +2201,12 @@ func (m *ProfileType) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2255,7 +2229,7 @@ func (m *Labels) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2283,7 +2257,7 @@ func (m *Labels) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2296,11 +2270,11 @@ func (m *Labels) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2312,12 +2286,12 @@ func (m *Labels) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2340,7 +2314,7 @@ func (m *Series) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2368,7 +2342,7 @@ func (m *Series) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2381,11 +2355,11 @@ func (m *Series) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2402,7 +2376,7 @@ func (m *Series) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2415,11 +2389,11 @@ func (m *Series) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2431,12 +2405,12 @@ func (m *Series) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2459,7 +2433,7 @@ func (m *Point) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2498,7 +2472,7 @@ func (m *Point) UnmarshalVT(dAtA []byte) error { m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2512,12 +2486,12 @@ func (m *Point) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2540,7 +2514,7 @@ func (m *LabelValuesRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2568,7 +2542,7 @@ func (m *LabelValuesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2582,11 +2556,11 @@ func (m *LabelValuesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2600,7 +2574,7 @@ func (m *LabelValuesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2614,11 +2588,11 @@ func (m *LabelValuesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2632,7 +2606,7 @@ func (m *LabelValuesRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2651,7 +2625,7 @@ func (m *LabelValuesRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2665,12 +2639,12 @@ func (m *LabelValuesRequest) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2693,7 +2667,7 @@ func (m *LabelValuesResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2721,7 +2695,7 @@ func (m *LabelValuesResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2735,11 +2709,11 @@ func (m *LabelValuesResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2748,12 +2722,12 @@ func (m *LabelValuesResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2776,7 +2750,7 @@ func (m *LabelNamesRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2804,7 +2778,7 @@ func (m *LabelNamesRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2818,11 +2792,11 @@ func (m *LabelNamesRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2836,7 +2810,7 @@ func (m *LabelNamesRequest) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2855,7 +2829,7 @@ func (m *LabelNamesRequest) UnmarshalVT(dAtA []byte) error { m.End = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2869,12 +2843,12 @@ func (m *LabelNamesRequest) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2897,7 +2871,7 @@ func (m *LabelNamesResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2925,7 +2899,7 @@ func (m *LabelNamesResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2939,11 +2913,11 @@ func (m *LabelNamesResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2952,12 +2926,12 @@ func (m *LabelNamesResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2980,7 +2954,7 @@ func (m *BlockInfo) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3008,7 +2982,7 @@ func (m *BlockInfo) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3022,11 +2996,11 @@ func (m *BlockInfo) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3040,7 +3014,7 @@ func (m *BlockInfo) UnmarshalVT(dAtA []byte) error { m.MinTime = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3059,7 +3033,7 @@ func (m *BlockInfo) UnmarshalVT(dAtA []byte) error { m.MaxTime = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3078,7 +3052,7 @@ func (m *BlockInfo) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3091,11 +3065,11 @@ func (m *BlockInfo) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3114,7 +3088,7 @@ func (m *BlockInfo) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3127,11 +3101,11 @@ func (m *BlockInfo) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3143,12 +3117,12 @@ func (m *BlockInfo) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3171,7 +3145,7 @@ func (m *BlockCompaction) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3199,7 +3173,7 @@ func (m *BlockCompaction) UnmarshalVT(dAtA []byte) error { m.Level = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3218,7 +3192,7 @@ func (m *BlockCompaction) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3232,11 +3206,11 @@ func (m *BlockCompaction) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3250,7 +3224,7 @@ func (m *BlockCompaction) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3264,11 +3238,11 @@ func (m *BlockCompaction) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3277,12 +3251,12 @@ func (m *BlockCompaction) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3305,7 +3279,7 @@ func (m *StackTraceSelector) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3333,7 +3307,7 @@ func (m *StackTraceSelector) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3346,11 +3320,11 @@ func (m *StackTraceSelector) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3362,12 +3336,12 @@ func (m *StackTraceSelector) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3390,7 +3364,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3418,7 +3392,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3432,11 +3406,11 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -3445,12 +3419,12 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3473,7 +3447,7 @@ func (m *GetProfileStatsRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3496,12 +3470,12 @@ func (m *GetProfileStatsRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3524,7 +3498,7 @@ func (m *GetProfileStatsResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3552,7 +3526,7 @@ func (m *GetProfileStatsResponse) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3572,7 +3546,7 @@ func (m *GetProfileStatsResponse) UnmarshalVT(dAtA []byte) error { m.OldestProfileTime = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3591,7 +3565,7 @@ func (m *GetProfileStatsResponse) UnmarshalVT(dAtA []byte) error { m.NewestProfileTime = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -3605,12 +3579,12 @@ func (m *GetProfileStatsResponse) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -3625,88 +3599,3 @@ func (m *GetProfileStatsResponse) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/api/gen/proto/go/vcs/v1/vcs.pb.go b/api/gen/proto/go/vcs/v1/vcs.pb.go index 4e980b5e1a..ee5a294d38 100644 --- a/api/gen/proto/go/vcs/v1/vcs.pb.go +++ b/api/gen/proto/go/vcs/v1/vcs.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: vcs/v1/vcs.proto diff --git a/api/gen/proto/go/vcs/v1/vcs_vtproto.pb.go b/api/gen/proto/go/vcs/v1/vcs_vtproto.pb.go index 7f45d2ff76..2fdca50621 100644 --- a/api/gen/proto/go/vcs/v1/vcs_vtproto.pb.go +++ b/api/gen/proto/go/vcs/v1/vcs_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: vcs/v1/vcs.proto package vcsv1 @@ -7,13 +7,13 @@ package vcsv1 import ( context "context" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -27,7 +27,7 @@ func (m *GithubAppRequest) CloneVT() *GithubAppRequest { if m == nil { return (*GithubAppRequest)(nil) } - r := &GithubAppRequest{} + r := new(GithubAppRequest) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -43,9 +43,8 @@ func (m *GithubAppResponse) CloneVT() *GithubAppResponse { if m == nil { return (*GithubAppResponse)(nil) } - r := &GithubAppResponse{ - ClientID: m.ClientID, - } + r := new(GithubAppResponse) + r.ClientID = m.ClientID if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -61,9 +60,8 @@ func (m *GithubLoginRequest) CloneVT() *GithubLoginRequest { if m == nil { return (*GithubLoginRequest)(nil) } - r := &GithubLoginRequest{ - AuthorizationCode: m.AuthorizationCode, - } + r := new(GithubLoginRequest) + r.AuthorizationCode = m.AuthorizationCode if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -79,9 +77,8 @@ func (m *GithubLoginResponse) CloneVT() *GithubLoginResponse { if m == nil { return (*GithubLoginResponse)(nil) } - r := &GithubLoginResponse{ - Cookie: m.Cookie, - } + r := new(GithubLoginResponse) + r.Cookie = m.Cookie if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -97,7 +94,7 @@ func (m *GithubRefreshRequest) CloneVT() *GithubRefreshRequest { if m == nil { return (*GithubRefreshRequest)(nil) } - r := &GithubRefreshRequest{} + r := new(GithubRefreshRequest) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -113,9 +110,8 @@ func (m *GithubRefreshResponse) CloneVT() *GithubRefreshResponse { if m == nil { return (*GithubRefreshResponse)(nil) } - r := &GithubRefreshResponse{ - Cookie: m.Cookie, - } + r := new(GithubRefreshResponse) + r.Cookie = m.Cookie if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -131,11 +127,10 @@ func (m *GetFileRequest) CloneVT() *GetFileRequest { if m == nil { return (*GetFileRequest)(nil) } - r := &GetFileRequest{ - RepositoryURL: m.RepositoryURL, - Ref: m.Ref, - LocalPath: m.LocalPath, - } + r := new(GetFileRequest) + r.RepositoryURL = m.RepositoryURL + r.Ref = m.Ref + r.LocalPath = m.LocalPath if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -151,10 +146,9 @@ func (m *GetFileResponse) CloneVT() *GetFileResponse { if m == nil { return (*GetFileResponse)(nil) } - r := &GetFileResponse{ - Content: m.Content, - URL: m.URL, - } + r := new(GetFileResponse) + r.Content = m.Content + r.URL = m.URL if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -170,10 +164,9 @@ func (m *GetCommitRequest) CloneVT() *GetCommitRequest { if m == nil { return (*GetCommitRequest)(nil) } - r := &GetCommitRequest{ - RepositoryURL: m.RepositoryURL, - Ref: m.Ref, - } + r := new(GetCommitRequest) + r.RepositoryURL = m.RepositoryURL + r.Ref = m.Ref if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -189,13 +182,12 @@ func (m *GetCommitResponse) CloneVT() *GetCommitResponse { if m == nil { return (*GetCommitResponse)(nil) } - r := &GetCommitResponse{ - Message: m.Message, - Author: m.Author.CloneVT(), - Date: m.Date, - Sha: m.Sha, - URL: m.URL, - } + r := new(GetCommitResponse) + r.Message = m.Message + r.Author = m.Author.CloneVT() + r.Date = m.Date + r.Sha = m.Sha + r.URL = m.URL if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -211,10 +203,9 @@ func (m *CommitAuthor) CloneVT() *CommitAuthor { if m == nil { return (*CommitAuthor)(nil) } - r := &CommitAuthor{ - Login: m.Login, - AvatarURL: m.AvatarURL, - } + r := new(CommitAuthor) + r.Login = m.Login + r.AvatarURL = m.AvatarURL if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -758,7 +749,7 @@ func (m *GithubAppResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.ClientID) > 0 { i -= len(m.ClientID) copy(dAtA[i:], m.ClientID) - i = encodeVarint(dAtA, i, uint64(len(m.ClientID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ClientID))) i-- dAtA[i] = 0xa } @@ -798,7 +789,7 @@ func (m *GithubLoginRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.AuthorizationCode) > 0 { i -= len(m.AuthorizationCode) copy(dAtA[i:], m.AuthorizationCode) - i = encodeVarint(dAtA, i, uint64(len(m.AuthorizationCode))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AuthorizationCode))) i-- dAtA[i] = 0xa } @@ -838,7 +829,7 @@ func (m *GithubLoginResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Cookie) > 0 { i -= len(m.Cookie) copy(dAtA[i:], m.Cookie) - i = encodeVarint(dAtA, i, uint64(len(m.Cookie))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Cookie))) i-- dAtA[i] = 0xa } @@ -911,7 +902,7 @@ func (m *GithubRefreshResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) if len(m.Cookie) > 0 { i -= len(m.Cookie) copy(dAtA[i:], m.Cookie) - i = encodeVarint(dAtA, i, uint64(len(m.Cookie))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Cookie))) i-- dAtA[i] = 0xa } @@ -951,21 +942,21 @@ func (m *GetFileRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.LocalPath) > 0 { i -= len(m.LocalPath) copy(dAtA[i:], m.LocalPath) - i = encodeVarint(dAtA, i, uint64(len(m.LocalPath))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LocalPath))) i-- dAtA[i] = 0x1a } if len(m.Ref) > 0 { i -= len(m.Ref) copy(dAtA[i:], m.Ref) - i = encodeVarint(dAtA, i, uint64(len(m.Ref))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ref))) i-- dAtA[i] = 0x12 } if len(m.RepositoryURL) > 0 { i -= len(m.RepositoryURL) copy(dAtA[i:], m.RepositoryURL) - i = encodeVarint(dAtA, i, uint64(len(m.RepositoryURL))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepositoryURL))) i-- dAtA[i] = 0xa } @@ -1005,14 +996,14 @@ func (m *GetFileResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.URL) > 0 { i -= len(m.URL) copy(dAtA[i:], m.URL) - i = encodeVarint(dAtA, i, uint64(len(m.URL))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.URL))) i-- dAtA[i] = 0x12 } if len(m.Content) > 0 { i -= len(m.Content) copy(dAtA[i:], m.Content) - i = encodeVarint(dAtA, i, uint64(len(m.Content))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Content))) i-- dAtA[i] = 0xa } @@ -1052,14 +1043,14 @@ func (m *GetCommitRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Ref) > 0 { i -= len(m.Ref) copy(dAtA[i:], m.Ref) - i = encodeVarint(dAtA, i, uint64(len(m.Ref))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Ref))) i-- dAtA[i] = 0x12 } if len(m.RepositoryURL) > 0 { i -= len(m.RepositoryURL) copy(dAtA[i:], m.RepositoryURL) - i = encodeVarint(dAtA, i, uint64(len(m.RepositoryURL))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepositoryURL))) i-- dAtA[i] = 0xa } @@ -1099,21 +1090,21 @@ func (m *GetCommitResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.URL) > 0 { i -= len(m.URL) copy(dAtA[i:], m.URL) - i = encodeVarint(dAtA, i, uint64(len(m.URL))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.URL))) i-- dAtA[i] = 0x2a } if len(m.Sha) > 0 { i -= len(m.Sha) copy(dAtA[i:], m.Sha) - i = encodeVarint(dAtA, i, uint64(len(m.Sha))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Sha))) i-- dAtA[i] = 0x22 } if len(m.Date) > 0 { i -= len(m.Date) copy(dAtA[i:], m.Date) - i = encodeVarint(dAtA, i, uint64(len(m.Date))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Date))) i-- dAtA[i] = 0x1a } @@ -1123,14 +1114,14 @@ func (m *GetCommitResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } if len(m.Message) > 0 { i -= len(m.Message) copy(dAtA[i:], m.Message) - i = encodeVarint(dAtA, i, uint64(len(m.Message))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Message))) i-- dAtA[i] = 0xa } @@ -1170,31 +1161,20 @@ func (m *CommitAuthor) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.AvatarURL) > 0 { i -= len(m.AvatarURL) copy(dAtA[i:], m.AvatarURL) - i = encodeVarint(dAtA, i, uint64(len(m.AvatarURL))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AvatarURL))) i-- dAtA[i] = 0x12 } if len(m.Login) > 0 { i -= len(m.Login) copy(dAtA[i:], m.Login) - i = encodeVarint(dAtA, i, uint64(len(m.Login))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Login))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *GithubAppRequest) SizeVT() (n int) { if m == nil { return 0 @@ -1213,7 +1193,7 @@ func (m *GithubAppResponse) SizeVT() (n int) { _ = l l = len(m.ClientID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1227,7 +1207,7 @@ func (m *GithubLoginRequest) SizeVT() (n int) { _ = l l = len(m.AuthorizationCode) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1241,7 +1221,7 @@ func (m *GithubLoginResponse) SizeVT() (n int) { _ = l l = len(m.Cookie) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1265,7 +1245,7 @@ func (m *GithubRefreshResponse) SizeVT() (n int) { _ = l l = len(m.Cookie) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1279,15 +1259,15 @@ func (m *GetFileRequest) SizeVT() (n int) { _ = l l = len(m.RepositoryURL) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Ref) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.LocalPath) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1301,11 +1281,11 @@ func (m *GetFileResponse) SizeVT() (n int) { _ = l l = len(m.Content) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.URL) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1319,11 +1299,11 @@ func (m *GetCommitRequest) SizeVT() (n int) { _ = l l = len(m.RepositoryURL) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Ref) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1337,23 +1317,23 @@ func (m *GetCommitResponse) SizeVT() (n int) { _ = l l = len(m.Message) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Author != nil { l = m.Author.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Date) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Sha) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.URL) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -1367,22 +1347,16 @@ func (m *CommitAuthor) SizeVT() (n int) { _ = l l = len(m.Login) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.AvatarURL) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *GithubAppRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1391,7 +1365,7 @@ func (m *GithubAppRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1414,12 +1388,12 @@ func (m *GithubAppRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1442,7 +1416,7 @@ func (m *GithubAppResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1470,7 +1444,7 @@ func (m *GithubAppResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1484,11 +1458,11 @@ func (m *GithubAppResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1497,12 +1471,12 @@ func (m *GithubAppResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1525,7 +1499,7 @@ func (m *GithubLoginRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1553,7 +1527,7 @@ func (m *GithubLoginRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1567,11 +1541,11 @@ func (m *GithubLoginRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1580,12 +1554,12 @@ func (m *GithubLoginRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1608,7 +1582,7 @@ func (m *GithubLoginResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1636,7 +1610,7 @@ func (m *GithubLoginResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1650,11 +1624,11 @@ func (m *GithubLoginResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1663,12 +1637,12 @@ func (m *GithubLoginResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1691,7 +1665,7 @@ func (m *GithubRefreshRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1714,12 +1688,12 @@ func (m *GithubRefreshRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1742,7 +1716,7 @@ func (m *GithubRefreshResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1770,7 +1744,7 @@ func (m *GithubRefreshResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1784,11 +1758,11 @@ func (m *GithubRefreshResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1797,12 +1771,12 @@ func (m *GithubRefreshResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1825,7 +1799,7 @@ func (m *GetFileRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1853,7 +1827,7 @@ func (m *GetFileRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1867,11 +1841,11 @@ func (m *GetFileRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1885,7 +1859,7 @@ func (m *GetFileRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1899,11 +1873,11 @@ func (m *GetFileRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1917,7 +1891,7 @@ func (m *GetFileRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1931,11 +1905,11 @@ func (m *GetFileRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1944,12 +1918,12 @@ func (m *GetFileRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1972,7 +1946,7 @@ func (m *GetFileResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2000,7 +1974,7 @@ func (m *GetFileResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2014,11 +1988,11 @@ func (m *GetFileResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2032,7 +2006,7 @@ func (m *GetFileResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2046,11 +2020,11 @@ func (m *GetFileResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2059,12 +2033,12 @@ func (m *GetFileResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2087,7 +2061,7 @@ func (m *GetCommitRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2115,7 +2089,7 @@ func (m *GetCommitRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2129,11 +2103,11 @@ func (m *GetCommitRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2147,7 +2121,7 @@ func (m *GetCommitRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2161,11 +2135,11 @@ func (m *GetCommitRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2174,12 +2148,12 @@ func (m *GetCommitRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2202,7 +2176,7 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2230,7 +2204,7 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2244,11 +2218,11 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2262,7 +2236,7 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2275,11 +2249,11 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2298,7 +2272,7 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2312,11 +2286,11 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2330,7 +2304,7 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2344,11 +2318,11 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2362,7 +2336,7 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2376,11 +2350,11 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2389,12 +2363,12 @@ func (m *GetCommitResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2417,7 +2391,7 @@ func (m *CommitAuthor) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2445,7 +2419,7 @@ func (m *CommitAuthor) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2459,11 +2433,11 @@ func (m *CommitAuthor) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2477,7 +2451,7 @@ func (m *CommitAuthor) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2491,11 +2465,11 @@ func (m *CommitAuthor) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2504,12 +2478,12 @@ func (m *CommitAuthor) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2524,88 +2498,3 @@ func (m *CommitAuthor) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/api/gen/proto/go/version/v1/version.pb.go b/api/gen/proto/go/version/v1/version.pb.go index cdbbec70f6..9909712bfa 100644 --- a/api/gen/proto/go/version/v1/version.pb.go +++ b/api/gen/proto/go/version/v1/version.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: version/v1/version.proto diff --git a/api/gen/proto/go/version/v1/version_vtproto.pb.go b/api/gen/proto/go/version/v1/version_vtproto.pb.go index 0d5e6cec09..e381f896d7 100644 --- a/api/gen/proto/go/version/v1/version_vtproto.pb.go +++ b/api/gen/proto/go/version/v1/version_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: version/v1/version.proto package versionv1 @@ -7,13 +7,13 @@ package versionv1 import ( context "context" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -27,7 +27,7 @@ func (m *VersionRequest) CloneVT() *VersionRequest { if m == nil { return (*VersionRequest)(nil) } - r := &VersionRequest{} + r := new(VersionRequest) if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -43,9 +43,8 @@ func (m *VersionResponse) CloneVT() *VersionResponse { if m == nil { return (*VersionResponse)(nil) } - r := &VersionResponse{ - QuerierAPI: m.QuerierAPI, - } + r := new(VersionResponse) + r.QuerierAPI = m.QuerierAPI if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -61,13 +60,12 @@ func (m *InstanceVersion) CloneVT() *InstanceVersion { if m == nil { return (*InstanceVersion)(nil) } - r := &InstanceVersion{ - ID: m.ID, - Addr: m.Addr, - Timestamp: m.Timestamp, - QuerierAPI: m.QuerierAPI, - Left: m.Left, - } + r := new(InstanceVersion) + r.ID = m.ID + r.Addr = m.Addr + r.Timestamp = m.Timestamp + r.QuerierAPI = m.QuerierAPI + r.Left = m.Left if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -83,7 +81,7 @@ func (m *Versions) CloneVT() *Versions { if m == nil { return (*Versions)(nil) } - r := &Versions{} + r := new(Versions) if rhs := m.Instances; rhs != nil { tmpContainer := make(map[string]*InstanceVersion, len(rhs)) for k, v := range rhs { @@ -360,7 +358,7 @@ func (m *VersionResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.QuerierAPI != 0 { - i = encodeVarint(dAtA, i, uint64(m.QuerierAPI)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.QuerierAPI)) i-- dAtA[i] = 0x8 } @@ -408,26 +406,26 @@ func (m *InstanceVersion) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x28 } if m.QuerierAPI != 0 { - i = encodeVarint(dAtA, i, uint64(m.QuerierAPI)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.QuerierAPI)) i-- dAtA[i] = 0x20 } if m.Timestamp != 0 { - i = encodeVarint(dAtA, i, uint64(m.Timestamp)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x18 } if len(m.Addr) > 0 { i -= len(m.Addr) copy(dAtA[i:], m.Addr) - i = encodeVarint(dAtA, i, uint64(len(m.Addr))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Addr))) i-- dAtA[i] = 0x12 } if len(m.ID) > 0 { i -= len(m.ID) copy(dAtA[i:], m.ID) - i = encodeVarint(dAtA, i, uint64(len(m.ID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ID))) i-- dAtA[i] = 0xa } @@ -473,15 +471,15 @@ func (m *Versions) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } @@ -489,17 +487,6 @@ func (m *Versions) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *VersionRequest) SizeVT() (n int) { if m == nil { return 0 @@ -517,7 +504,7 @@ func (m *VersionResponse) SizeVT() (n int) { var l int _ = l if m.QuerierAPI != 0 { - n += 1 + sov(uint64(m.QuerierAPI)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.QuerierAPI)) } n += len(m.unknownFields) return n @@ -531,17 +518,17 @@ func (m *InstanceVersion) SizeVT() (n int) { _ = l l = len(m.ID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Addr) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Timestamp != 0 { - n += 1 + sov(uint64(m.Timestamp)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Timestamp)) } if m.QuerierAPI != 0 { - n += 1 + sov(uint64(m.QuerierAPI)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.QuerierAPI)) } if m.Left { n += 2 @@ -564,21 +551,15 @@ func (m *Versions) SizeVT() (n int) { if v != nil { l = v.SizeVT() } - l += 1 + sov(uint64(l)) - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + l += 1 + protohelpers.SizeOfVarint(uint64(l)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *VersionRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -587,7 +568,7 @@ func (m *VersionRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -610,12 +591,12 @@ func (m *VersionRequest) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -638,7 +619,7 @@ func (m *VersionResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -666,7 +647,7 @@ func (m *VersionResponse) UnmarshalVT(dAtA []byte) error { m.QuerierAPI = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -680,12 +661,12 @@ func (m *VersionResponse) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -708,7 +689,7 @@ func (m *InstanceVersion) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -736,7 +717,7 @@ func (m *InstanceVersion) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -750,11 +731,11 @@ func (m *InstanceVersion) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -768,7 +749,7 @@ func (m *InstanceVersion) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -782,11 +763,11 @@ func (m *InstanceVersion) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -800,7 +781,7 @@ func (m *InstanceVersion) UnmarshalVT(dAtA []byte) error { m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -819,7 +800,7 @@ func (m *InstanceVersion) UnmarshalVT(dAtA []byte) error { m.QuerierAPI = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -838,7 +819,7 @@ func (m *InstanceVersion) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -853,12 +834,12 @@ func (m *InstanceVersion) UnmarshalVT(dAtA []byte) error { m.Left = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -881,7 +862,7 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -909,7 +890,7 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -922,11 +903,11 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -941,7 +922,7 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -958,7 +939,7 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -972,11 +953,11 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -987,7 +968,7 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1000,11 +981,11 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -1016,12 +997,12 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -1033,12 +1014,12 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1053,88 +1034,3 @@ func (m *Versions) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/api/go.mod b/api/go.mod index 65e803be3e..f784c4156b 100644 --- a/api/go.mod +++ b/api/go.mod @@ -6,10 +6,11 @@ require ( connectrpc.com/connect v1.14.0 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 + github.com/planetscale/vtprotobuf v0.6.0 github.com/prometheus/common v0.52.3 google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 google.golang.org/grpc v1.62.1 - google.golang.org/protobuf v1.33.0 + google.golang.org/protobuf v1.34.1 ) require ( diff --git a/api/go.sum b/api/go.sum index 7a0f97d7d1..18c47dc99c 100644 --- a/api/go.sum +++ b/api/go.sum @@ -10,6 +10,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU= +github.com/planetscale/vtprotobuf v0.6.0 h1:nBeETjudeJ5ZgBHUz1fVHvbqUKnYOXNhsIEabROxmNA= +github.com/planetscale/vtprotobuf v0.6.0/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/prometheus/common v0.52.3 h1:5f8uj6ZwHSscOGNdIQg6OiZv/ybiK2CO2q2drVZAQSA= github.com/prometheus/common v0.52.3/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= @@ -27,5 +29,5 @@ google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= diff --git a/ebpf/go.mod b/ebpf/go.mod index a74ff8b09f..225ed97cf7 100644 --- a/ebpf/go.mod +++ b/ebpf/go.mod @@ -42,7 +42,7 @@ require ( google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240304161311-37d4d3c04a78 // indirect google.golang.org/grpc v1.62.1 // indirect - google.golang.org/protobuf v1.33.0 // indirect + google.golang.org/protobuf v1.34.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/ebpf/go.sum b/ebpf/go.sum index 6c89b98216..073aecb30e 100644 --- a/ebpf/go.sum +++ b/ebpf/go.sum @@ -105,8 +105,8 @@ google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/go.mod b/go.mod index dd416b2004..17bf4da6f0 100644 --- a/go.mod +++ b/go.mod @@ -52,6 +52,7 @@ require ( github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b github.com/parquet-go/parquet-go v0.18.1-0.20231004061202-cde8189c4c26 github.com/pkg/errors v0.9.1 + github.com/planetscale/vtprotobuf v0.6.0 github.com/prometheus/client_golang v1.19.0 github.com/prometheus/client_model v0.6.0 github.com/prometheus/common v0.52.3 @@ -78,7 +79,7 @@ require ( golang.org/x/time v0.5.0 google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 google.golang.org/grpc v1.62.1 - google.golang.org/protobuf v1.33.0 + google.golang.org/protobuf v1.34.1 gopkg.in/alecthomas/kingpin.v2 v2.2.6 gopkg.in/yaml.v3 v3.0.1 sigs.k8s.io/yaml v1.3.0 diff --git a/go.sum b/go.sum index 4c61fc0fd4..6b93cfecc6 100644 --- a/go.sum +++ b/go.sum @@ -600,6 +600,8 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.0 h1:nBeETjudeJ5ZgBHUz1fVHvbqUKnYOXNhsIEabROxmNA= +github.com/planetscale/vtprotobuf v0.6.0/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -1097,8 +1099,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/go.work.sum b/go.work.sum index 974d66d41f..d717f02355 100644 --- a/go.work.sum +++ b/go.work.sum @@ -933,8 +933,6 @@ github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= -github.com/prometheus/common v0.52.3 h1:5f8uj6ZwHSscOGNdIQg6OiZv/ybiK2CO2q2drVZAQSA= -github.com/prometheus/common v0.52.3/go.mod h1:BrxBKv3FWBIGXw89Mg1AeBq7FSyRzXWI3l3e7W3RN5U= github.com/prometheus/common/assets v0.2.0 h1:0P5OrzoHrYBOSM1OigWL3mY8ZvV2N4zIE/5AahrSrfM= github.com/prometheus/common/assets v0.2.0/go.mod h1:D17UVUE12bHbim7HzwUvtqm6gwBEaDQ0F+hIGbFbccI= github.com/prometheus/exporter-toolkit v0.10.0/go.mod h1:+sVFzuvV5JDyw+Ih6p3zFxZNVnKQa3x5qPmDSiPu4ZY= @@ -1319,6 +1317,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/gcfg.v1 v1.2.3 h1:m8OOJ4ccYHnx2f4gQwpno8nAX5OGOh7RLaaz0pj3Ogs= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= diff --git a/pkg/frontend/frontendpb/frontend.pb.go b/pkg/frontend/frontendpb/frontend.pb.go index 7f0431b60e..5741acb828 100644 --- a/pkg/frontend/frontendpb/frontend.pb.go +++ b/pkg/frontend/frontendpb/frontend.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: frontend/frontendpb/frontend.proto diff --git a/pkg/frontend/frontendpb/frontend_vtproto.pb.go b/pkg/frontend/frontendpb/frontend_vtproto.pb.go index 98f4202dcb..b2491af94d 100644 --- a/pkg/frontend/frontendpb/frontend_vtproto.pb.go +++ b/pkg/frontend/frontendpb/frontend_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: frontend/frontendpb/frontend.proto package frontendpb @@ -9,13 +9,13 @@ import ( fmt "fmt" stats "github.com/grafana/pyroscope/pkg/querier/stats" httpgrpc "github.com/grafana/pyroscope/pkg/util/httpgrpc" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -155,7 +155,7 @@ func (m *QueryResultRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.Stats) if err != nil { @@ -163,7 +163,7 @@ func (m *QueryResultRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x1a @@ -177,7 +177,7 @@ func (m *QueryResultRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.HttpResponse) if err != nil { @@ -185,13 +185,13 @@ func (m *QueryResultRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 } if m.QueryID != 0 { - i = encodeVarint(dAtA, i, uint64(m.QueryID)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.QueryID)) i-- dAtA[i] = 0x8 } @@ -231,17 +231,6 @@ func (m *QueryResultResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *QueryResultRequest) SizeVT() (n int) { if m == nil { return 0 @@ -249,7 +238,7 @@ func (m *QueryResultRequest) SizeVT() (n int) { var l int _ = l if m.QueryID != 0 { - n += 1 + sov(uint64(m.QueryID)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.QueryID)) } if m.HttpResponse != nil { if size, ok := interface{}(m.HttpResponse).(interface { @@ -259,7 +248,7 @@ func (m *QueryResultRequest) SizeVT() (n int) { } else { l = proto.Size(m.HttpResponse) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Stats != nil { if size, ok := interface{}(m.Stats).(interface { @@ -269,7 +258,7 @@ func (m *QueryResultRequest) SizeVT() (n int) { } else { l = proto.Size(m.Stats) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -285,12 +274,6 @@ func (m *QueryResultResponse) SizeVT() (n int) { return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *QueryResultRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -299,7 +282,7 @@ func (m *QueryResultRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -327,7 +310,7 @@ func (m *QueryResultRequest) UnmarshalVT(dAtA []byte) error { m.QueryID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -346,7 +329,7 @@ func (m *QueryResultRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -359,11 +342,11 @@ func (m *QueryResultRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -390,7 +373,7 @@ func (m *QueryResultRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -403,11 +386,11 @@ func (m *QueryResultRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -429,12 +412,12 @@ func (m *QueryResultRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -457,7 +440,7 @@ func (m *QueryResultResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -480,12 +463,12 @@ func (m *QueryResultResponse) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -500,88 +483,3 @@ func (m *QueryResultResponse) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/og/storage/tree/profile.pb.go b/pkg/og/storage/tree/profile.pb.go index 9fd7e96c7a..fdf226a6f0 100644 --- a/pkg/og/storage/tree/profile.pb.go +++ b/pkg/og/storage/tree/profile.pb.go @@ -38,7 +38,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: og/storage/tree/profile.proto diff --git a/pkg/og/storage/tree/profile_vtproto.pb.go b/pkg/og/storage/tree/profile_vtproto.pb.go index 510499f1c6..aa01fdf142 100644 --- a/pkg/og/storage/tree/profile_vtproto.pb.go +++ b/pkg/og/storage/tree/profile_vtproto.pb.go @@ -1,14 +1,14 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: og/storage/tree/profile.proto package tree import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" sync "sync" ) @@ -50,14 +50,14 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.DefaultSampleType != 0 { - i = encodeVarint(dAtA, i, uint64(m.DefaultSampleType)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DefaultSampleType)) i-- dAtA[i] = 0x70 } if len(m.Comment) > 0 { var pksize2 int for _, num := range m.Comment { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -71,12 +71,12 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x6a } if m.Period != 0 { - i = encodeVarint(dAtA, i, uint64(m.Period)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Period)) i-- dAtA[i] = 0x60 } @@ -86,27 +86,27 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x5a } if m.DurationNanos != 0 { - i = encodeVarint(dAtA, i, uint64(m.DurationNanos)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DurationNanos)) i-- dAtA[i] = 0x50 } if m.TimeNanos != 0 { - i = encodeVarint(dAtA, i, uint64(m.TimeNanos)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TimeNanos)) i-- dAtA[i] = 0x48 } if m.KeepFrames != 0 { - i = encodeVarint(dAtA, i, uint64(m.KeepFrames)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.KeepFrames)) i-- dAtA[i] = 0x40 } if m.DropFrames != 0 { - i = encodeVarint(dAtA, i, uint64(m.DropFrames)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.DropFrames)) i-- dAtA[i] = 0x38 } @@ -114,7 +114,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.StringTable) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.StringTable[iNdEx]) copy(dAtA[i:], m.StringTable[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.StringTable[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.StringTable[iNdEx]))) i-- dAtA[i] = 0x32 } @@ -126,7 +126,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -138,7 +138,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -150,7 +150,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -162,7 +162,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -174,7 +174,7 @@ func (m *Profile) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0xa } @@ -213,12 +213,12 @@ func (m *ValueType) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.Unit != 0 { - i = encodeVarint(dAtA, i, uint64(m.Unit)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Unit)) i-- dAtA[i] = 0x10 } if m.Type != 0 { - i = encodeVarint(dAtA, i, uint64(m.Type)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) i-- dAtA[i] = 0x8 } @@ -262,7 +262,7 @@ func (m *Sample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -270,7 +270,7 @@ func (m *Sample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Value) > 0 { var pksize2 int for _, num := range m.Value { - pksize2 += sov(uint64(num)) + pksize2 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize2 j1 := i @@ -284,14 +284,14 @@ func (m *Sample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j1] = uint8(num) j1++ } - i = encodeVarint(dAtA, i, uint64(pksize2)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize2)) i-- dAtA[i] = 0x12 } if len(m.LocationId) > 0 { var pksize4 int for _, num := range m.LocationId { - pksize4 += sov(uint64(num)) + pksize4 += protohelpers.SizeOfVarint(uint64(num)) } i -= pksize4 j3 := i @@ -304,7 +304,7 @@ func (m *Sample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[j3] = uint8(num) j3++ } - i = encodeVarint(dAtA, i, uint64(pksize4)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(pksize4)) i-- dAtA[i] = 0xa } @@ -342,22 +342,22 @@ func (m *Label) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.NumUnit != 0 { - i = encodeVarint(dAtA, i, uint64(m.NumUnit)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.NumUnit)) i-- dAtA[i] = 0x20 } if m.Num != 0 { - i = encodeVarint(dAtA, i, uint64(m.Num)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Num)) i-- dAtA[i] = 0x18 } if m.Str != 0 { - i = encodeVarint(dAtA, i, uint64(m.Str)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Str)) i-- dAtA[i] = 0x10 } if m.Key != 0 { - i = encodeVarint(dAtA, i, uint64(m.Key)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Key)) i-- dAtA[i] = 0x8 } @@ -435,32 +435,32 @@ func (m *Mapping) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x38 } if m.BuildId != 0 { - i = encodeVarint(dAtA, i, uint64(m.BuildId)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.BuildId)) i-- dAtA[i] = 0x30 } if m.Filename != 0 { - i = encodeVarint(dAtA, i, uint64(m.Filename)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Filename)) i-- dAtA[i] = 0x28 } if m.FileOffset != 0 { - i = encodeVarint(dAtA, i, uint64(m.FileOffset)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FileOffset)) i-- dAtA[i] = 0x20 } if m.MemoryLimit != 0 { - i = encodeVarint(dAtA, i, uint64(m.MemoryLimit)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MemoryLimit)) i-- dAtA[i] = 0x18 } if m.MemoryStart != 0 { - i = encodeVarint(dAtA, i, uint64(m.MemoryStart)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MemoryStart)) i-- dAtA[i] = 0x10 } if m.Id != 0 { - i = encodeVarint(dAtA, i, uint64(m.Id)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -514,23 +514,23 @@ func (m *Location) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } } if m.Address != 0 { - i = encodeVarint(dAtA, i, uint64(m.Address)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Address)) i-- dAtA[i] = 0x18 } if m.MappingId != 0 { - i = encodeVarint(dAtA, i, uint64(m.MappingId)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.MappingId)) i-- dAtA[i] = 0x10 } if m.Id != 0 { - i = encodeVarint(dAtA, i, uint64(m.Id)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } @@ -568,12 +568,12 @@ func (m *Line) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.Line != 0 { - i = encodeVarint(dAtA, i, uint64(m.Line)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Line)) i-- dAtA[i] = 0x10 } if m.FunctionId != 0 { - i = encodeVarint(dAtA, i, uint64(m.FunctionId)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FunctionId)) i-- dAtA[i] = 0x8 } @@ -611,45 +611,33 @@ func (m *Function) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.StartLine != 0 { - i = encodeVarint(dAtA, i, uint64(m.StartLine)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.StartLine)) i-- dAtA[i] = 0x28 } if m.Filename != 0 { - i = encodeVarint(dAtA, i, uint64(m.Filename)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Filename)) i-- dAtA[i] = 0x20 } if m.SystemName != 0 { - i = encodeVarint(dAtA, i, uint64(m.SystemName)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SystemName)) i-- dAtA[i] = 0x18 } if m.Name != 0 { - i = encodeVarint(dAtA, i, uint64(m.Name)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Name)) i-- dAtA[i] = 0x10 } if m.Id != 0 { - i = encodeVarint(dAtA, i, uint64(m.Id)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Id)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - var vtprotoPool_Profile = sync.Pool{ New: func() interface{} { return &Profile{} @@ -657,46 +645,38 @@ var vtprotoPool_Profile = sync.Pool{ } func (m *Profile) ResetVT() { - for _, mm := range m.SampleType[:cap(m.SampleType)] { - if mm != nil { + if m != nil { + for _, mm := range m.SampleType { mm.Reset() } - } - f0 := m.SampleType[:0] - for _, mm := range m.Sample[:cap(m.Sample)] { - if mm != nil { + f0 := m.SampleType[:0] + for _, mm := range m.Sample { mm.Reset() } - } - f1 := m.Sample[:0] - for _, mm := range m.Mapping[:cap(m.Mapping)] { - if mm != nil { + f1 := m.Sample[:0] + for _, mm := range m.Mapping { mm.Reset() } - } - f2 := m.Mapping[:0] - for _, mm := range m.Location[:cap(m.Location)] { - if mm != nil { + f2 := m.Mapping[:0] + for _, mm := range m.Location { mm.Reset() } - } - f3 := m.Location[:0] - for _, mm := range m.Function[:cap(m.Function)] { - if mm != nil { + f3 := m.Location[:0] + for _, mm := range m.Function { mm.Reset() } + f4 := m.Function[:0] + f5 := m.StringTable[:0] + f6 := m.Comment[:0] + m.Reset() + m.SampleType = f0 + m.Sample = f1 + m.Mapping = f2 + m.Location = f3 + m.Function = f4 + m.StringTable = f5 + m.Comment = f6 } - f4 := m.Function[:0] - f5 := m.StringTable[:0] - f6 := m.Comment[:0] - m.Reset() - m.SampleType = f0 - m.Sample = f1 - m.Mapping = f2 - m.Location = f3 - m.Function = f4 - m.StringTable = f5 - m.Comment = f6 } func (m *Profile) ReturnToVTPool() { if m != nil { @@ -716,67 +696,67 @@ func (m *Profile) SizeVT() (n int) { if len(m.SampleType) > 0 { for _, e := range m.SampleType { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Sample) > 0 { for _, e := range m.Sample { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Mapping) > 0 { for _, e := range m.Mapping { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Location) > 0 { for _, e := range m.Location { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Function) > 0 { for _, e := range m.Function { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.StringTable) > 0 { for _, s := range m.StringTable { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.DropFrames != 0 { - n += 1 + sov(uint64(m.DropFrames)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.DropFrames)) } if m.KeepFrames != 0 { - n += 1 + sov(uint64(m.KeepFrames)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.KeepFrames)) } if m.TimeNanos != 0 { - n += 1 + sov(uint64(m.TimeNanos)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.TimeNanos)) } if m.DurationNanos != 0 { - n += 1 + sov(uint64(m.DurationNanos)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.DurationNanos)) } if m.PeriodType != nil { l = m.PeriodType.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Period != 0 { - n += 1 + sov(uint64(m.Period)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Period)) } if len(m.Comment) > 0 { l = 0 for _, e := range m.Comment { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } if m.DefaultSampleType != 0 { - n += 1 + sov(uint64(m.DefaultSampleType)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.DefaultSampleType)) } n += len(m.unknownFields) return n @@ -789,10 +769,10 @@ func (m *ValueType) SizeVT() (n int) { var l int _ = l if m.Type != 0 { - n += 1 + sov(uint64(m.Type)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) } if m.Unit != 0 { - n += 1 + sov(uint64(m.Unit)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Unit)) } n += len(m.unknownFields) return n @@ -807,21 +787,21 @@ func (m *Sample) SizeVT() (n int) { if len(m.LocationId) > 0 { l = 0 for _, e := range m.LocationId { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.Value) > 0 { l = 0 for _, e := range m.Value { - l += sov(uint64(e)) + l += protohelpers.SizeOfVarint(uint64(e)) } - n += 1 + sov(uint64(l)) + l + n += 1 + protohelpers.SizeOfVarint(uint64(l)) + l } if len(m.Label) > 0 { for _, e := range m.Label { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) @@ -835,16 +815,16 @@ func (m *Label) SizeVT() (n int) { var l int _ = l if m.Key != 0 { - n += 1 + sov(uint64(m.Key)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Key)) } if m.Str != 0 { - n += 1 + sov(uint64(m.Str)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Str)) } if m.Num != 0 { - n += 1 + sov(uint64(m.Num)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Num)) } if m.NumUnit != 0 { - n += 1 + sov(uint64(m.NumUnit)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.NumUnit)) } n += len(m.unknownFields) return n @@ -857,22 +837,22 @@ func (m *Mapping) SizeVT() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sov(uint64(m.Id)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Id)) } if m.MemoryStart != 0 { - n += 1 + sov(uint64(m.MemoryStart)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MemoryStart)) } if m.MemoryLimit != 0 { - n += 1 + sov(uint64(m.MemoryLimit)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MemoryLimit)) } if m.FileOffset != 0 { - n += 1 + sov(uint64(m.FileOffset)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.FileOffset)) } if m.Filename != 0 { - n += 1 + sov(uint64(m.Filename)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Filename)) } if m.BuildId != 0 { - n += 1 + sov(uint64(m.BuildId)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.BuildId)) } if m.HasFunctions { n += 2 @@ -897,18 +877,18 @@ func (m *Location) SizeVT() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sov(uint64(m.Id)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Id)) } if m.MappingId != 0 { - n += 1 + sov(uint64(m.MappingId)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.MappingId)) } if m.Address != 0 { - n += 1 + sov(uint64(m.Address)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Address)) } if len(m.Line) > 0 { for _, e := range m.Line { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.IsFolded { @@ -925,10 +905,10 @@ func (m *Line) SizeVT() (n int) { var l int _ = l if m.FunctionId != 0 { - n += 1 + sov(uint64(m.FunctionId)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.FunctionId)) } if m.Line != 0 { - n += 1 + sov(uint64(m.Line)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Line)) } n += len(m.unknownFields) return n @@ -941,30 +921,24 @@ func (m *Function) SizeVT() (n int) { var l int _ = l if m.Id != 0 { - n += 1 + sov(uint64(m.Id)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Id)) } if m.Name != 0 { - n += 1 + sov(uint64(m.Name)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Name)) } if m.SystemName != 0 { - n += 1 + sov(uint64(m.SystemName)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SystemName)) } if m.Filename != 0 { - n += 1 + sov(uint64(m.Filename)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Filename)) } if m.StartLine != 0 { - n += 1 + sov(uint64(m.StartLine)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.StartLine)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *Profile) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -973,7 +947,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1001,7 +975,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1014,11 +988,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1042,7 +1016,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1055,11 +1029,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1083,7 +1057,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1096,11 +1070,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1124,7 +1098,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1137,11 +1111,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1165,7 +1139,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1178,11 +1152,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1206,7 +1180,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1220,11 +1194,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1238,7 +1212,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.DropFrames = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1257,7 +1231,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.KeepFrames = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1276,7 +1250,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.TimeNanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1295,7 +1269,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.DurationNanos = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1314,7 +1288,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1327,11 +1301,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1350,7 +1324,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.Period = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1367,7 +1341,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1384,7 +1358,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1397,11 +1371,11 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1421,7 +1395,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1445,7 +1419,7 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { m.DefaultSampleType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1459,12 +1433,12 @@ func (m *Profile) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1487,7 +1461,7 @@ func (m *ValueType) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1515,7 +1489,7 @@ func (m *ValueType) UnmarshalVT(dAtA []byte) error { m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1534,7 +1508,7 @@ func (m *ValueType) UnmarshalVT(dAtA []byte) error { m.Unit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1548,12 +1522,12 @@ func (m *ValueType) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1576,7 +1550,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1602,7 +1576,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1619,7 +1593,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1632,11 +1606,11 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1656,7 +1630,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1678,7 +1652,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1695,7 +1669,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1708,11 +1682,11 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1732,7 +1706,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1756,7 +1730,7 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1769,11 +1743,11 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1785,12 +1759,12 @@ func (m *Sample) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1813,7 +1787,7 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1841,7 +1815,7 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { m.Key = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1860,7 +1834,7 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { m.Str = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1879,7 +1853,7 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { m.Num = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1898,7 +1872,7 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { m.NumUnit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1912,12 +1886,12 @@ func (m *Label) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1940,7 +1914,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1968,7 +1942,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1987,7 +1961,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.MemoryStart = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2006,7 +1980,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.MemoryLimit = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2025,7 +1999,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.FileOffset = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2044,7 +2018,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.Filename = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2063,7 +2037,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.BuildId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2082,7 +2056,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2102,7 +2076,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2122,7 +2096,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2142,7 +2116,7 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2157,12 +2131,12 @@ func (m *Mapping) UnmarshalVT(dAtA []byte) error { m.HasInlineFrames = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2185,7 +2159,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2213,7 +2187,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2232,7 +2206,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { m.MappingId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2251,7 +2225,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { m.Address = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2270,7 +2244,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2283,11 +2257,11 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -2304,7 +2278,7 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2319,12 +2293,12 @@ func (m *Location) UnmarshalVT(dAtA []byte) error { m.IsFolded = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2347,7 +2321,7 @@ func (m *Line) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2375,7 +2349,7 @@ func (m *Line) UnmarshalVT(dAtA []byte) error { m.FunctionId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2394,7 +2368,7 @@ func (m *Line) UnmarshalVT(dAtA []byte) error { m.Line = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2408,12 +2382,12 @@ func (m *Line) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2436,7 +2410,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2464,7 +2438,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2483,7 +2457,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { m.Name = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2502,7 +2476,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { m.SystemName = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2521,7 +2495,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { m.Filename = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2540,7 +2514,7 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { m.StartLine = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -2554,12 +2528,12 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -2574,88 +2548,3 @@ func (m *Function) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/querier/stats/stats.pb.go b/pkg/querier/stats/stats.pb.go index dd59ef030b..8919f1e9fa 100644 --- a/pkg/querier/stats/stats.pb.go +++ b/pkg/querier/stats/stats.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: querier/stats/stats.proto diff --git a/pkg/querier/stats/stats_vtproto.pb.go b/pkg/querier/stats/stats_vtproto.pb.go index 2798cd98bb..06f4644413 100644 --- a/pkg/querier/stats/stats_vtproto.pb.go +++ b/pkg/querier/stats/stats_vtproto.pb.go @@ -1,14 +1,14 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: querier/stats/stats.proto package stats import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -49,54 +49,43 @@ func (m *Stats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.FetchedIndexBytes != 0 { - i = encodeVarint(dAtA, i, uint64(m.FetchedIndexBytes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FetchedIndexBytes)) i-- dAtA[i] = 0x38 } if m.SplitQueries != 0 { - i = encodeVarint(dAtA, i, uint64(m.SplitQueries)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SplitQueries)) i-- dAtA[i] = 0x30 } if m.ShardedQueries != 0 { - i = encodeVarint(dAtA, i, uint64(m.ShardedQueries)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ShardedQueries)) i-- dAtA[i] = 0x28 } if m.FetchedChunksCount != 0 { - i = encodeVarint(dAtA, i, uint64(m.FetchedChunksCount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FetchedChunksCount)) i-- dAtA[i] = 0x20 } if m.FetchedChunkBytes != 0 { - i = encodeVarint(dAtA, i, uint64(m.FetchedChunkBytes)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FetchedChunkBytes)) i-- dAtA[i] = 0x18 } if m.FetchedSeriesCount != 0 { - i = encodeVarint(dAtA, i, uint64(m.FetchedSeriesCount)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.FetchedSeriesCount)) i-- dAtA[i] = 0x10 } if m.WallTime != 0 { - i = encodeVarint(dAtA, i, uint64(m.WallTime)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.WallTime)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *Stats) SizeVT() (n int) { if m == nil { return 0 @@ -104,36 +93,30 @@ func (m *Stats) SizeVT() (n int) { var l int _ = l if m.WallTime != 0 { - n += 1 + sov(uint64(m.WallTime)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.WallTime)) } if m.FetchedSeriesCount != 0 { - n += 1 + sov(uint64(m.FetchedSeriesCount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.FetchedSeriesCount)) } if m.FetchedChunkBytes != 0 { - n += 1 + sov(uint64(m.FetchedChunkBytes)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.FetchedChunkBytes)) } if m.FetchedChunksCount != 0 { - n += 1 + sov(uint64(m.FetchedChunksCount)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.FetchedChunksCount)) } if m.ShardedQueries != 0 { - n += 1 + sov(uint64(m.ShardedQueries)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ShardedQueries)) } if m.SplitQueries != 0 { - n += 1 + sov(uint64(m.SplitQueries)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SplitQueries)) } if m.FetchedIndexBytes != 0 { - n += 1 + sov(uint64(m.FetchedIndexBytes)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.FetchedIndexBytes)) } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *Stats) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -142,7 +125,7 @@ func (m *Stats) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -170,7 +153,7 @@ func (m *Stats) UnmarshalVT(dAtA []byte) error { m.WallTime = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -189,7 +172,7 @@ func (m *Stats) UnmarshalVT(dAtA []byte) error { m.FetchedSeriesCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -208,7 +191,7 @@ func (m *Stats) UnmarshalVT(dAtA []byte) error { m.FetchedChunkBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -227,7 +210,7 @@ func (m *Stats) UnmarshalVT(dAtA []byte) error { m.FetchedChunksCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -246,7 +229,7 @@ func (m *Stats) UnmarshalVT(dAtA []byte) error { m.ShardedQueries = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -265,7 +248,7 @@ func (m *Stats) UnmarshalVT(dAtA []byte) error { m.SplitQueries = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -284,7 +267,7 @@ func (m *Stats) UnmarshalVT(dAtA []byte) error { m.FetchedIndexBytes = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -298,12 +281,12 @@ func (m *Stats) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -318,88 +301,3 @@ func (m *Stats) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/scheduler/schedulerpb/scheduler.pb.go b/pkg/scheduler/schedulerpb/scheduler.pb.go index 4f4f1f39d8..e717d927cf 100644 --- a/pkg/scheduler/schedulerpb/scheduler.pb.go +++ b/pkg/scheduler/schedulerpb/scheduler.pb.go @@ -5,7 +5,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: scheduler/schedulerpb/scheduler.proto diff --git a/pkg/scheduler/schedulerpb/scheduler_vtproto.pb.go b/pkg/scheduler/schedulerpb/scheduler_vtproto.pb.go index ac4e6b88e6..bd4c4c6531 100644 --- a/pkg/scheduler/schedulerpb/scheduler_vtproto.pb.go +++ b/pkg/scheduler/schedulerpb/scheduler_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: scheduler/schedulerpb/scheduler.proto package schedulerpb @@ -8,13 +8,13 @@ import ( context "context" fmt "fmt" httpgrpc "github.com/grafana/pyroscope/pkg/util/httpgrpc" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -361,7 +361,7 @@ func (m *QuerierToScheduler) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.QuerierID) > 0 { i -= len(m.QuerierID) copy(dAtA[i:], m.QuerierID) - i = encodeVarint(dAtA, i, uint64(len(m.QuerierID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.QuerierID))) i-- dAtA[i] = 0xa } @@ -411,14 +411,14 @@ func (m *SchedulerToQuerier) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.UserID) > 0 { i -= len(m.UserID) copy(dAtA[i:], m.UserID) - i = encodeVarint(dAtA, i, uint64(len(m.UserID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.UserID))) i-- dAtA[i] = 0x22 } if len(m.FrontendAddress) > 0 { i -= len(m.FrontendAddress) copy(dAtA[i:], m.FrontendAddress) - i = encodeVarint(dAtA, i, uint64(len(m.FrontendAddress))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.FrontendAddress))) i-- dAtA[i] = 0x1a } @@ -431,7 +431,7 @@ func (m *SchedulerToQuerier) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.HttpRequest) if err != nil { @@ -439,13 +439,13 @@ func (m *SchedulerToQuerier) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x12 } if m.QueryID != 0 { - i = encodeVarint(dAtA, i, uint64(m.QueryID)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.QueryID)) i-- dAtA[i] = 0x8 } @@ -501,7 +501,7 @@ func (m *FrontendToScheduler) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) } else { encoded, err := proto.Marshal(m.HttpRequest) if err != nil { @@ -509,7 +509,7 @@ func (m *FrontendToScheduler) MarshalToSizedBufferVT(dAtA []byte) (int, error) { } i -= len(encoded) copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) } i-- dAtA[i] = 0x2a @@ -517,24 +517,24 @@ func (m *FrontendToScheduler) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.UserID) > 0 { i -= len(m.UserID) copy(dAtA[i:], m.UserID) - i = encodeVarint(dAtA, i, uint64(len(m.UserID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.UserID))) i-- dAtA[i] = 0x22 } if m.QueryID != 0 { - i = encodeVarint(dAtA, i, uint64(m.QueryID)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.QueryID)) i-- dAtA[i] = 0x18 } if len(m.FrontendAddress) > 0 { i -= len(m.FrontendAddress) copy(dAtA[i:], m.FrontendAddress) - i = encodeVarint(dAtA, i, uint64(len(m.FrontendAddress))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.FrontendAddress))) i-- dAtA[i] = 0x12 } if m.Type != 0 { - i = encodeVarint(dAtA, i, uint64(m.Type)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Type)) i-- dAtA[i] = 0x8 } @@ -574,12 +574,12 @@ func (m *SchedulerToFrontend) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Error) > 0 { i -= len(m.Error) copy(dAtA[i:], m.Error) - i = encodeVarint(dAtA, i, uint64(len(m.Error))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Error))) i-- dAtA[i] = 0x12 } if m.Status != 0 { - i = encodeVarint(dAtA, i, uint64(m.Status)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Status)) i-- dAtA[i] = 0x8 } @@ -619,7 +619,7 @@ func (m *NotifyQuerierShutdownRequest) MarshalToSizedBufferVT(dAtA []byte) (int, if len(m.QuerierID) > 0 { i -= len(m.QuerierID) copy(dAtA[i:], m.QuerierID) - i = encodeVarint(dAtA, i, uint64(len(m.QuerierID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.QuerierID))) i-- dAtA[i] = 0xa } @@ -659,17 +659,6 @@ func (m *NotifyQuerierShutdownResponse) MarshalToSizedBufferVT(dAtA []byte) (int return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *QuerierToScheduler) SizeVT() (n int) { if m == nil { return 0 @@ -678,7 +667,7 @@ func (m *QuerierToScheduler) SizeVT() (n int) { _ = l l = len(m.QuerierID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -691,7 +680,7 @@ func (m *SchedulerToQuerier) SizeVT() (n int) { var l int _ = l if m.QueryID != 0 { - n += 1 + sov(uint64(m.QueryID)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.QueryID)) } if m.HttpRequest != nil { if size, ok := interface{}(m.HttpRequest).(interface { @@ -701,15 +690,15 @@ func (m *SchedulerToQuerier) SizeVT() (n int) { } else { l = proto.Size(m.HttpRequest) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.FrontendAddress) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.UserID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.StatsEnabled { n += 2 @@ -725,18 +714,18 @@ func (m *FrontendToScheduler) SizeVT() (n int) { var l int _ = l if m.Type != 0 { - n += 1 + sov(uint64(m.Type)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Type)) } l = len(m.FrontendAddress) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.QueryID != 0 { - n += 1 + sov(uint64(m.QueryID)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.QueryID)) } l = len(m.UserID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.HttpRequest != nil { if size, ok := interface{}(m.HttpRequest).(interface { @@ -746,7 +735,7 @@ func (m *FrontendToScheduler) SizeVT() (n int) { } else { l = proto.Size(m.HttpRequest) } - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.StatsEnabled { n += 2 @@ -762,11 +751,11 @@ func (m *SchedulerToFrontend) SizeVT() (n int) { var l int _ = l if m.Status != 0 { - n += 1 + sov(uint64(m.Status)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Status)) } l = len(m.Error) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -780,7 +769,7 @@ func (m *NotifyQuerierShutdownRequest) SizeVT() (n int) { _ = l l = len(m.QuerierID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -796,12 +785,6 @@ func (m *NotifyQuerierShutdownResponse) SizeVT() (n int) { return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *QuerierToScheduler) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -810,7 +793,7 @@ func (m *QuerierToScheduler) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -838,7 +821,7 @@ func (m *QuerierToScheduler) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -852,11 +835,11 @@ func (m *QuerierToScheduler) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -865,12 +848,12 @@ func (m *QuerierToScheduler) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -893,7 +876,7 @@ func (m *SchedulerToQuerier) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -921,7 +904,7 @@ func (m *SchedulerToQuerier) UnmarshalVT(dAtA []byte) error { m.QueryID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -940,7 +923,7 @@ func (m *SchedulerToQuerier) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -953,11 +936,11 @@ func (m *SchedulerToQuerier) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -984,7 +967,7 @@ func (m *SchedulerToQuerier) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -998,11 +981,11 @@ func (m *SchedulerToQuerier) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1016,7 +999,7 @@ func (m *SchedulerToQuerier) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1030,11 +1013,11 @@ func (m *SchedulerToQuerier) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1048,7 +1031,7 @@ func (m *SchedulerToQuerier) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1063,12 +1046,12 @@ func (m *SchedulerToQuerier) UnmarshalVT(dAtA []byte) error { m.StatsEnabled = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1091,7 +1074,7 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1119,7 +1102,7 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { m.Type = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1138,7 +1121,7 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1152,11 +1135,11 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1170,7 +1153,7 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { m.QueryID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1189,7 +1172,7 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1203,11 +1186,11 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1221,7 +1204,7 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1234,11 +1217,11 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1265,7 +1248,7 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1280,12 +1263,12 @@ func (m *FrontendToScheduler) UnmarshalVT(dAtA []byte) error { m.StatsEnabled = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1308,7 +1291,7 @@ func (m *SchedulerToFrontend) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1336,7 +1319,7 @@ func (m *SchedulerToFrontend) UnmarshalVT(dAtA []byte) error { m.Status = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1355,7 +1338,7 @@ func (m *SchedulerToFrontend) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1369,11 +1352,11 @@ func (m *SchedulerToFrontend) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1382,12 +1365,12 @@ func (m *SchedulerToFrontend) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1410,7 +1393,7 @@ func (m *NotifyQuerierShutdownRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1438,7 +1421,7 @@ func (m *NotifyQuerierShutdownRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1452,11 +1435,11 @@ func (m *NotifyQuerierShutdownRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1465,12 +1448,12 @@ func (m *NotifyQuerierShutdownRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1493,7 +1476,7 @@ func (m *NotifyQuerierShutdownResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1516,12 +1499,12 @@ func (m *NotifyQuerierShutdownResponse) UnmarshalVT(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1536,88 +1519,3 @@ func (m *NotifyQuerierShutdownResponse) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/util/httpgrpc/httpgrpc.pb.go b/pkg/util/httpgrpc/httpgrpc.pb.go index 897ac70553..41d98cb476 100644 --- a/pkg/util/httpgrpc/httpgrpc.pb.go +++ b/pkg/util/httpgrpc/httpgrpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: util/httpgrpc/httpgrpc.proto diff --git a/pkg/util/httpgrpc/httpgrpc_vtproto.pb.go b/pkg/util/httpgrpc/httpgrpc_vtproto.pb.go index 1faa6b5024..ac7c4615ad 100644 --- a/pkg/util/httpgrpc/httpgrpc_vtproto.pb.go +++ b/pkg/util/httpgrpc/httpgrpc_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.0.0-20230725111439-5b3aae6571b8 +// protoc-gen-go-vtproto version: v0.6.0 // source: util/httpgrpc/httpgrpc.proto package httpgrpc @@ -7,12 +7,12 @@ package httpgrpc import ( context "context" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" - bits "math/bits" ) const ( @@ -146,7 +146,7 @@ func (m *HTTPRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Body) > 0 { i -= len(m.Body) copy(dAtA[i:], m.Body) - i = encodeVarint(dAtA, i, uint64(len(m.Body))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) i-- dAtA[i] = 0x22 } @@ -157,7 +157,7 @@ func (m *HTTPRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -165,14 +165,14 @@ func (m *HTTPRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Url) > 0 { i -= len(m.Url) copy(dAtA[i:], m.Url) - i = encodeVarint(dAtA, i, uint64(len(m.Url))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Url))) i-- dAtA[i] = 0x12 } if len(m.Method) > 0 { i -= len(m.Method) copy(dAtA[i:], m.Method) - i = encodeVarint(dAtA, i, uint64(len(m.Method))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Method))) i-- dAtA[i] = 0xa } @@ -212,7 +212,7 @@ func (m *HTTPResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Body) > 0 { i -= len(m.Body) copy(dAtA[i:], m.Body) - i = encodeVarint(dAtA, i, uint64(len(m.Body))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Body))) i-- dAtA[i] = 0x1a } @@ -223,13 +223,13 @@ func (m *HTTPResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } } if m.Code != 0 { - i = encodeVarint(dAtA, i, uint64(m.Code)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Code)) i-- dAtA[i] = 0x8 } @@ -270,7 +270,7 @@ func (m *Header) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Values[iNdEx]) copy(dAtA[i:], m.Values[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Values[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Values[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -278,24 +278,13 @@ func (m *Header) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Key) > 0 { i -= len(m.Key) copy(dAtA[i:], m.Key) - i = encodeVarint(dAtA, i, uint64(len(m.Key))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Key))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *HTTPRequest) SizeVT() (n int) { if m == nil { return 0 @@ -304,21 +293,21 @@ func (m *HTTPRequest) SizeVT() (n int) { _ = l l = len(m.Method) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Url) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Headers) > 0 { for _, e := range m.Headers { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } l = len(m.Body) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -331,17 +320,17 @@ func (m *HTTPResponse) SizeVT() (n int) { var l int _ = l if m.Code != 0 { - n += 1 + sov(uint64(m.Code)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Code)) } if len(m.Headers) > 0 { for _, e := range m.Headers { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } l = len(m.Body) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -355,24 +344,18 @@ func (m *Header) SizeVT() (n int) { _ = l l = len(m.Key) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Values) > 0 { for _, s := range m.Values { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -381,7 +364,7 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -409,7 +392,7 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -423,11 +406,11 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -441,7 +424,7 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -455,11 +438,11 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -473,7 +456,7 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -486,11 +469,11 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -507,7 +490,7 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -520,11 +503,11 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -536,12 +519,12 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -564,7 +547,7 @@ func (m *HTTPResponse) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -592,7 +575,7 @@ func (m *HTTPResponse) UnmarshalVT(dAtA []byte) error { m.Code = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -611,7 +594,7 @@ func (m *HTTPResponse) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -624,11 +607,11 @@ func (m *HTTPResponse) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -645,7 +628,7 @@ func (m *HTTPResponse) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -658,11 +641,11 @@ func (m *HTTPResponse) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -674,12 +657,12 @@ func (m *HTTPResponse) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -702,7 +685,7 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -730,7 +713,7 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -744,11 +727,11 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -762,7 +745,7 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -776,11 +759,11 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -789,12 +772,12 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -809,88 +792,3 @@ func (m *Header) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -)