* fixed mk-rel.sh; put all release artifiacts in releases/ dir * updated vt-proto dependencies
512 lines
11 KiB
Go
512 lines
11 KiB
Go
// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
|
|
// protoc-gen-go-vtproto version: v0.6.0
|
|
// source: internal/pb/hdr.proto
|
|
|
|
package pb
|
|
|
|
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 *Header) 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 *Header) MarshalToVT(dAtA []byte) (int, error) {
|
|
size := m.SizeVT()
|
|
return m.MarshalToSizedBufferVT(dAtA[:size])
|
|
}
|
|
|
|
func (m *Header) 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.Keys) > 0 {
|
|
for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- {
|
|
size, err := m.Keys[iNdEx].MarshalToSizedBufferVT(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(size))
|
|
i--
|
|
dAtA[i] = 0x2a
|
|
}
|
|
}
|
|
if len(m.Sender) > 0 {
|
|
i -= len(m.Sender)
|
|
copy(dAtA[i:], m.Sender)
|
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Sender)))
|
|
i--
|
|
dAtA[i] = 0x22
|
|
}
|
|
if len(m.Pk) > 0 {
|
|
i -= len(m.Pk)
|
|
copy(dAtA[i:], m.Pk)
|
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Pk)))
|
|
i--
|
|
dAtA[i] = 0x1a
|
|
}
|
|
if len(m.Salt) > 0 {
|
|
i -= len(m.Salt)
|
|
copy(dAtA[i:], m.Salt)
|
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Salt)))
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
if m.ChunkSize != 0 {
|
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ChunkSize))
|
|
i--
|
|
dAtA[i] = 0x8
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *WrappedKey) 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 *WrappedKey) MarshalToVT(dAtA []byte) (int, error) {
|
|
size := m.SizeVT()
|
|
return m.MarshalToSizedBufferVT(dAtA[:size])
|
|
}
|
|
|
|
func (m *WrappedKey) 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.Nonce) > 0 {
|
|
i -= len(m.Nonce)
|
|
copy(dAtA[i:], m.Nonce)
|
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Nonce)))
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
if len(m.DKey) > 0 {
|
|
i -= len(m.DKey)
|
|
copy(dAtA[i:], m.DKey)
|
|
i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DKey)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *Header) SizeVT() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.ChunkSize != 0 {
|
|
n += 1 + protohelpers.SizeOfVarint(uint64(m.ChunkSize))
|
|
}
|
|
l = len(m.Salt)
|
|
if l > 0 {
|
|
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
|
|
}
|
|
l = len(m.Pk)
|
|
if l > 0 {
|
|
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
|
|
}
|
|
l = len(m.Sender)
|
|
if l > 0 {
|
|
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
|
|
}
|
|
if len(m.Keys) > 0 {
|
|
for _, e := range m.Keys {
|
|
l = e.SizeVT()
|
|
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
|
|
}
|
|
}
|
|
n += len(m.unknownFields)
|
|
return n
|
|
}
|
|
|
|
func (m *WrappedKey) SizeVT() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.DKey)
|
|
if l > 0 {
|
|
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
|
|
}
|
|
l = len(m.Nonce)
|
|
if l > 0 {
|
|
n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
|
|
}
|
|
n += len(m.unknownFields)
|
|
return n
|
|
}
|
|
|
|
func (m *Header) 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: Header: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field ChunkSize", wireType)
|
|
}
|
|
m.ChunkSize = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return protohelpers.ErrIntOverflow
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.ChunkSize |= uint32(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Salt", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return protohelpers.ErrIntOverflow
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Salt = append(m.Salt[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.Salt == nil {
|
|
m.Salt = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Pk", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return protohelpers.ErrIntOverflow
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Pk = append(m.Pk[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.Pk == nil {
|
|
m.Pk = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
case 4:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return protohelpers.ErrIntOverflow
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Sender = append(m.Sender[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.Sender == nil {
|
|
m.Sender = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
case 5:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return protohelpers.ErrIntOverflow
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Keys = append(m.Keys, &WrappedKey{})
|
|
if err := m.Keys[len(m.Keys)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
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 *WrappedKey) 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: WrappedKey: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: WrappedKey: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field DKey", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return protohelpers.ErrIntOverflow
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.DKey = append(m.DKey[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.DKey == nil {
|
|
m.DKey = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return protohelpers.ErrIntOverflow
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return protohelpers.ErrInvalidLength
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Nonce = append(m.Nonce[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.Nonce == nil {
|
|
m.Nonce = []byte{}
|
|
}
|
|
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
|
|
}
|