mirror of
https://github.com/linka-cloud/grpc.git
synced 2024-11-23 11:26:26 +00:00
322 lines
6.9 KiB
Go
322 lines
6.9 KiB
Go
|
// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
|
||
|
// protoc-gen-go-vtproto version: v0.6.1-0.20240917153116-6f2963f01587
|
||
|
// source: proxy/testservice/test.proto
|
||
|
|
||
|
package testservice
|
||
|
|
||
|
import (
|
||
|
fmt "fmt"
|
||
|
protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
|
||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||
|
io "io"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
// Verify that this generated code is sufficiently up-to-date.
|
||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||
|
)
|
||
|
|
||
|
func (m *PingRequest) MarshalVT() (dAtA []byte, err error) {
|
||
|
if m == nil {
|
||
|
return nil, nil
|
||
|
}
|
||
|
size := m.SizeVT()
|
||
|
dAtA = make([]byte, size)
|
||
|
n, err := m.MarshalToSizedBufferVT(dAtA[:size])
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return dAtA[:n], nil
|
||
|
}
|
||
|
|
||
|
func (m *PingRequest) MarshalToVT(dAtA []byte) (int, error) {
|
||
|
size := m.SizeVT()
|
||
|
return m.MarshalToSizedBufferVT(dAtA[:size])
|
||
|
}
|
||
|
|
||
|
func (m *PingRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
||
|
if m == nil {
|
||
|
return 0, nil
|
||
|
}
|
||
|
i := len(dAtA)
|
||
|
_ = i
|
||
|
var l int
|
||
|
_ = l
|
||
|
if m.unknownFields != nil {
|
||
|
i -= len(m.unknownFields)
|
||
|
copy(dAtA[i:], m.unknownFields)
|
||
|
}
|
||
|
if len(m.Value) > 0 {
|
||
|
i -= len(m.Value)
|
||
|
copy(dAtA[i:], m.Value)
|
||
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value)))
|
||
|
i--
|
||
|
dAtA[i] = 0xa
|
||
|
}
|
||
|
return len(dAtA) - i, nil
|
||
|
}
|
||
|
|
||
|
func (m *PingResponse) MarshalVT() (dAtA []byte, err error) {
|
||
|
if m == nil {
|
||
|
return nil, nil
|
||
|
}
|
||
|
size := m.SizeVT()
|
||
|
dAtA = make([]byte, size)
|
||
|
n, err := m.MarshalToSizedBufferVT(dAtA[:size])
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return dAtA[:n], nil
|
||
|
}
|
||
|
|
||
|
func (m *PingResponse) MarshalToVT(dAtA []byte) (int, error) {
|
||
|
size := m.SizeVT()
|
||
|
return m.MarshalToSizedBufferVT(dAtA[:size])
|
||
|
}
|
||
|
|
||
|
func (m *PingResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
|
||
|
if m == nil {
|
||
|
return 0, nil
|
||
|
}
|
||
|
i := len(dAtA)
|
||
|
_ = i
|
||
|
var l int
|
||
|
_ = l
|
||
|
if m.unknownFields != nil {
|
||
|
i -= len(m.unknownFields)
|
||
|
copy(dAtA[i:], m.unknownFields)
|
||
|
}
|
||
|
if m.Counter != 0 {
|
||
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Counter))
|
||
|
i--
|
||
|
dAtA[i] = 0x10
|
||
|
}
|
||
|
if len(m.Value) > 0 {
|
||
|
i -= len(m.Value)
|
||
|
copy(dAtA[i:], m.Value)
|
||
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Value)))
|
||
|
i--
|
||
|
dAtA[i] = 0xa
|
||
|
}
|
||
|
return len(dAtA) - i, nil
|
||
|
}
|
||
|
|
||
|
func (m *PingRequest) SizeVT() (n int) {
|
||
|
if m == nil {
|
||
|
return 0
|
||
|
}
|
||
|
var l int
|
||
|
_ = l
|
||
|
l = len(m.Value)
|
||
|
if l > 0 {
|
||
|
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
|
||
|
}
|
||
|
n += len(m.unknownFields)
|
||
|
return n
|
||
|
}
|
||
|
|
||
|
func (m *PingResponse) SizeVT() (n int) {
|
||
|
if m == nil {
|
||
|
return 0
|
||
|
}
|
||
|
var l int
|
||
|
_ = l
|
||
|
l = len(m.Value)
|
||
|
if l > 0 {
|
||
|
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
|
||
|
}
|
||
|
if m.Counter != 0 {
|
||
|
n += 1 + protohelpers.SizeOfVarint(uint64(m.Counter))
|
||
|
}
|
||
|
n += len(m.unknownFields)
|
||
|
return n
|
||
|
}
|
||
|
|
||
|
func (m *PingRequest) UnmarshalVT(dAtA []byte) error {
|
||
|
l := len(dAtA)
|
||
|
iNdEx := 0
|
||
|
for iNdEx < l {
|
||
|
preIndex := iNdEx
|
||
|
var wire uint64
|
||
|
for shift := uint(0); ; shift += 7 {
|
||
|
if shift >= 64 {
|
||
|
return protohelpers.ErrIntOverflow
|
||
|
}
|
||
|
if iNdEx >= l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
b := dAtA[iNdEx]
|
||
|
iNdEx++
|
||
|
wire |= uint64(b&0x7F) << shift
|
||
|
if b < 0x80 {
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
fieldNum := int32(wire >> 3)
|
||
|
wireType := int(wire & 0x7)
|
||
|
if wireType == 4 {
|
||
|
return fmt.Errorf("proto: PingRequest: wiretype end group for non-group")
|
||
|
}
|
||
|
if fieldNum <= 0 {
|
||
|
return fmt.Errorf("proto: PingRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||
|
}
|
||
|
switch fieldNum {
|
||
|
case 1:
|
||
|
if wireType != 2 {
|
||
|
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
|
||
|
}
|
||
|
var stringLen uint64
|
||
|
for shift := uint(0); ; shift += 7 {
|
||
|
if shift >= 64 {
|
||
|
return protohelpers.ErrIntOverflow
|
||
|
}
|
||
|
if iNdEx >= l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
b := dAtA[iNdEx]
|
||
|
iNdEx++
|
||
|
stringLen |= uint64(b&0x7F) << shift
|
||
|
if b < 0x80 {
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
intStringLen := int(stringLen)
|
||
|
if intStringLen < 0 {
|
||
|
return protohelpers.ErrInvalidLength
|
||
|
}
|
||
|
postIndex := iNdEx + intStringLen
|
||
|
if postIndex < 0 {
|
||
|
return protohelpers.ErrInvalidLength
|
||
|
}
|
||
|
if postIndex > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
m.Value = string(dAtA[iNdEx:postIndex])
|
||
|
iNdEx = postIndex
|
||
|
default:
|
||
|
iNdEx = preIndex
|
||
|
skippy, err := protohelpers.Skip(dAtA[iNdEx:])
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||
|
return protohelpers.ErrInvalidLength
|
||
|
}
|
||
|
if (iNdEx + skippy) > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||
|
iNdEx += skippy
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if iNdEx > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
func (m *PingResponse) UnmarshalVT(dAtA []byte) error {
|
||
|
l := len(dAtA)
|
||
|
iNdEx := 0
|
||
|
for iNdEx < l {
|
||
|
preIndex := iNdEx
|
||
|
var wire uint64
|
||
|
for shift := uint(0); ; shift += 7 {
|
||
|
if shift >= 64 {
|
||
|
return protohelpers.ErrIntOverflow
|
||
|
}
|
||
|
if iNdEx >= l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
b := dAtA[iNdEx]
|
||
|
iNdEx++
|
||
|
wire |= uint64(b&0x7F) << shift
|
||
|
if b < 0x80 {
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
fieldNum := int32(wire >> 3)
|
||
|
wireType := int(wire & 0x7)
|
||
|
if wireType == 4 {
|
||
|
return fmt.Errorf("proto: PingResponse: wiretype end group for non-group")
|
||
|
}
|
||
|
if fieldNum <= 0 {
|
||
|
return fmt.Errorf("proto: PingResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||
|
}
|
||
|
switch fieldNum {
|
||
|
case 1:
|
||
|
if wireType != 2 {
|
||
|
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
|
||
|
}
|
||
|
var stringLen uint64
|
||
|
for shift := uint(0); ; shift += 7 {
|
||
|
if shift >= 64 {
|
||
|
return protohelpers.ErrIntOverflow
|
||
|
}
|
||
|
if iNdEx >= l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
b := dAtA[iNdEx]
|
||
|
iNdEx++
|
||
|
stringLen |= uint64(b&0x7F) << shift
|
||
|
if b < 0x80 {
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
intStringLen := int(stringLen)
|
||
|
if intStringLen < 0 {
|
||
|
return protohelpers.ErrInvalidLength
|
||
|
}
|
||
|
postIndex := iNdEx + intStringLen
|
||
|
if postIndex < 0 {
|
||
|
return protohelpers.ErrInvalidLength
|
||
|
}
|
||
|
if postIndex > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
m.Value = string(dAtA[iNdEx:postIndex])
|
||
|
iNdEx = postIndex
|
||
|
case 2:
|
||
|
if wireType != 0 {
|
||
|
return fmt.Errorf("proto: wrong wireType = %d for field Counter", wireType)
|
||
|
}
|
||
|
m.Counter = 0
|
||
|
for shift := uint(0); ; shift += 7 {
|
||
|
if shift >= 64 {
|
||
|
return protohelpers.ErrIntOverflow
|
||
|
}
|
||
|
if iNdEx >= l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
b := dAtA[iNdEx]
|
||
|
iNdEx++
|
||
|
m.Counter |= int32(b&0x7F) << shift
|
||
|
if b < 0x80 {
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
default:
|
||
|
iNdEx = preIndex
|
||
|
skippy, err := protohelpers.Skip(dAtA[iNdEx:])
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||
|
return protohelpers.ErrInvalidLength
|
||
|
}
|
||
|
if (iNdEx + skippy) > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
|
||
|
iNdEx += skippy
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if iNdEx > l {
|
||
|
return io.ErrUnexpectedEOF
|
||
|
}
|
||
|
return nil
|
||
|
}
|