1488 lines
35 KiB
Go
1488 lines
35 KiB
Go
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
// source: common/commonspace/spacesyncproto/protos/spacesync.proto
|
|
|
|
package spacesyncproto
|
|
|
|
import (
|
|
fmt "fmt"
|
|
proto "github.com/gogo/protobuf/proto"
|
|
io "io"
|
|
math "math"
|
|
math_bits "math/bits"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
type ErrCodes int32
|
|
|
|
const (
|
|
ErrCodes_Unexpected ErrCodes = 0
|
|
)
|
|
|
|
var ErrCodes_name = map[int32]string{
|
|
0: "Unexpected",
|
|
}
|
|
|
|
var ErrCodes_value = map[string]int32{
|
|
"Unexpected": 0,
|
|
}
|
|
|
|
func (x ErrCodes) String() string {
|
|
return proto.EnumName(ErrCodes_name, int32(x))
|
|
}
|
|
|
|
func (ErrCodes) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_5855f4ef9cf24cdb, []int{0}
|
|
}
|
|
|
|
// TODO: temporary mock message
|
|
type Msg struct {
|
|
SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"`
|
|
}
|
|
|
|
func (m *Msg) Reset() { *m = Msg{} }
|
|
func (m *Msg) String() string { return proto.CompactTextString(m) }
|
|
func (*Msg) ProtoMessage() {}
|
|
func (*Msg) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_5855f4ef9cf24cdb, []int{0}
|
|
}
|
|
func (m *Msg) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *Msg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_Msg.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *Msg) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Msg.Merge(m, src)
|
|
}
|
|
func (m *Msg) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *Msg) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Msg.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Msg proto.InternalMessageInfo
|
|
|
|
func (m *Msg) GetSpaceId() string {
|
|
if m != nil {
|
|
return m.SpaceId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// HeadSyncRange presenting a request for one range
|
|
type HeadSyncRange struct {
|
|
From uint64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"`
|
|
To uint64 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"`
|
|
Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
|
|
}
|
|
|
|
func (m *HeadSyncRange) Reset() { *m = HeadSyncRange{} }
|
|
func (m *HeadSyncRange) String() string { return proto.CompactTextString(m) }
|
|
func (*HeadSyncRange) ProtoMessage() {}
|
|
func (*HeadSyncRange) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_5855f4ef9cf24cdb, []int{1}
|
|
}
|
|
func (m *HeadSyncRange) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *HeadSyncRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_HeadSyncRange.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *HeadSyncRange) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_HeadSyncRange.Merge(m, src)
|
|
}
|
|
func (m *HeadSyncRange) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *HeadSyncRange) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_HeadSyncRange.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_HeadSyncRange proto.InternalMessageInfo
|
|
|
|
func (m *HeadSyncRange) GetFrom() uint64 {
|
|
if m != nil {
|
|
return m.From
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *HeadSyncRange) GetTo() uint64 {
|
|
if m != nil {
|
|
return m.To
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *HeadSyncRange) GetLimit() uint32 {
|
|
if m != nil {
|
|
return m.Limit
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// HeadSyncResult presenting a response for one range
|
|
type HeadSyncResult struct {
|
|
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
|
|
Elements []*HeadSyncResultElement `protobuf:"bytes,2,rep,name=elements,proto3" json:"elements,omitempty"`
|
|
Count uint32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
|
|
}
|
|
|
|
func (m *HeadSyncResult) Reset() { *m = HeadSyncResult{} }
|
|
func (m *HeadSyncResult) String() string { return proto.CompactTextString(m) }
|
|
func (*HeadSyncResult) ProtoMessage() {}
|
|
func (*HeadSyncResult) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_5855f4ef9cf24cdb, []int{2}
|
|
}
|
|
func (m *HeadSyncResult) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *HeadSyncResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_HeadSyncResult.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *HeadSyncResult) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_HeadSyncResult.Merge(m, src)
|
|
}
|
|
func (m *HeadSyncResult) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *HeadSyncResult) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_HeadSyncResult.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_HeadSyncResult proto.InternalMessageInfo
|
|
|
|
func (m *HeadSyncResult) GetHash() []byte {
|
|
if m != nil {
|
|
return m.Hash
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *HeadSyncResult) GetElements() []*HeadSyncResultElement {
|
|
if m != nil {
|
|
return m.Elements
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *HeadSyncResult) GetCount() uint32 {
|
|
if m != nil {
|
|
return m.Count
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// HeadSyncResultElement presenting state of one object
|
|
type HeadSyncResultElement struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
|
Head string `protobuf:"bytes,2,opt,name=head,proto3" json:"head,omitempty"`
|
|
}
|
|
|
|
func (m *HeadSyncResultElement) Reset() { *m = HeadSyncResultElement{} }
|
|
func (m *HeadSyncResultElement) String() string { return proto.CompactTextString(m) }
|
|
func (*HeadSyncResultElement) ProtoMessage() {}
|
|
func (*HeadSyncResultElement) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_5855f4ef9cf24cdb, []int{3}
|
|
}
|
|
func (m *HeadSyncResultElement) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *HeadSyncResultElement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_HeadSyncResultElement.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *HeadSyncResultElement) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_HeadSyncResultElement.Merge(m, src)
|
|
}
|
|
func (m *HeadSyncResultElement) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *HeadSyncResultElement) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_HeadSyncResultElement.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_HeadSyncResultElement proto.InternalMessageInfo
|
|
|
|
func (m *HeadSyncResultElement) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *HeadSyncResultElement) GetHead() string {
|
|
if m != nil {
|
|
return m.Head
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// HeadSyncRequest is a request for HeadSync
|
|
type HeadSyncRequest struct {
|
|
SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"`
|
|
Ranges []*HeadSyncRange `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges,omitempty"`
|
|
}
|
|
|
|
func (m *HeadSyncRequest) Reset() { *m = HeadSyncRequest{} }
|
|
func (m *HeadSyncRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*HeadSyncRequest) ProtoMessage() {}
|
|
func (*HeadSyncRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_5855f4ef9cf24cdb, []int{4}
|
|
}
|
|
func (m *HeadSyncRequest) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *HeadSyncRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_HeadSyncRequest.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *HeadSyncRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_HeadSyncRequest.Merge(m, src)
|
|
}
|
|
func (m *HeadSyncRequest) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *HeadSyncRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_HeadSyncRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_HeadSyncRequest proto.InternalMessageInfo
|
|
|
|
func (m *HeadSyncRequest) GetSpaceId() string {
|
|
if m != nil {
|
|
return m.SpaceId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *HeadSyncRequest) GetRanges() []*HeadSyncRange {
|
|
if m != nil {
|
|
return m.Ranges
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// HeadSyncResponse is a response for HeadSync
|
|
type HeadSyncResponse struct {
|
|
Results []*HeadSyncResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
|
|
}
|
|
|
|
func (m *HeadSyncResponse) Reset() { *m = HeadSyncResponse{} }
|
|
func (m *HeadSyncResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*HeadSyncResponse) ProtoMessage() {}
|
|
func (*HeadSyncResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_5855f4ef9cf24cdb, []int{5}
|
|
}
|
|
func (m *HeadSyncResponse) XXX_Unmarshal(b []byte) error {
|
|
return m.Unmarshal(b)
|
|
}
|
|
func (m *HeadSyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
if deterministic {
|
|
return xxx_messageInfo_HeadSyncResponse.Marshal(b, m, deterministic)
|
|
} else {
|
|
b = b[:cap(b)]
|
|
n, err := m.MarshalToSizedBuffer(b)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return b[:n], nil
|
|
}
|
|
}
|
|
func (m *HeadSyncResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_HeadSyncResponse.Merge(m, src)
|
|
}
|
|
func (m *HeadSyncResponse) XXX_Size() int {
|
|
return m.Size()
|
|
}
|
|
func (m *HeadSyncResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_HeadSyncResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_HeadSyncResponse proto.InternalMessageInfo
|
|
|
|
func (m *HeadSyncResponse) GetResults() []*HeadSyncResult {
|
|
if m != nil {
|
|
return m.Results
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterEnum("anySpace.ErrCodes", ErrCodes_name, ErrCodes_value)
|
|
proto.RegisterType((*Msg)(nil), "anySpace.Msg")
|
|
proto.RegisterType((*HeadSyncRange)(nil), "anySpace.HeadSyncRange")
|
|
proto.RegisterType((*HeadSyncResult)(nil), "anySpace.HeadSyncResult")
|
|
proto.RegisterType((*HeadSyncResultElement)(nil), "anySpace.HeadSyncResultElement")
|
|
proto.RegisterType((*HeadSyncRequest)(nil), "anySpace.HeadSyncRequest")
|
|
proto.RegisterType((*HeadSyncResponse)(nil), "anySpace.HeadSyncResponse")
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterFile("common/commonspace/spacesyncproto/protos/spacesync.proto", fileDescriptor_5855f4ef9cf24cdb)
|
|
}
|
|
|
|
var fileDescriptor_5855f4ef9cf24cdb = []byte{
|
|
// 400 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xcd, 0xce, 0xd2, 0x40,
|
|
0x14, 0xed, 0x94, 0xbf, 0x72, 0x15, 0x24, 0x13, 0x8d, 0xb5, 0x8b, 0x82, 0x5d, 0x35, 0x2c, 0xa8,
|
|
0xc1, 0x8d, 0x09, 0x2b, 0x35, 0x18, 0x59, 0xb0, 0x19, 0xe2, 0xc6, 0xb8, 0xa9, 0xed, 0x08, 0x4d,
|
|
0xe8, 0x4c, 0xed, 0x0c, 0x2a, 0x6f, 0xe1, 0x63, 0xb9, 0x64, 0xe9, 0xd2, 0xc0, 0x8b, 0x98, 0xde,
|
|
0x7e, 0x85, 0x8f, 0xa4, 0xe4, 0xdb, 0xcc, 0xfd, 0xe9, 0x39, 0xe7, 0x9e, 0x7b, 0x53, 0x78, 0x13,
|
|
0xc9, 0x34, 0x95, 0x22, 0x28, 0x83, 0xca, 0xc2, 0x88, 0x07, 0xf8, 0xaa, 0xbd, 0x88, 0xb2, 0x5c,
|
|
0x6a, 0x19, 0xe0, 0xab, 0x2e, 0xdd, 0x09, 0x36, 0xa8, 0x15, 0x8a, 0xfd, 0xaa, 0xe8, 0x79, 0x43,
|
|
0x68, 0x2c, 0xd5, 0x9a, 0xda, 0xd0, 0x41, 0xcc, 0x22, 0xb6, 0xc9, 0x88, 0xf8, 0x5d, 0x56, 0x95,
|
|
0xde, 0x02, 0x7a, 0x1f, 0x79, 0x18, 0xaf, 0xf6, 0x22, 0x62, 0xa1, 0x58, 0x73, 0x4a, 0xa1, 0xf9,
|
|
0x2d, 0x97, 0x29, 0xe2, 0x9a, 0x0c, 0x73, 0xda, 0x07, 0x53, 0x4b, 0xdb, 0xc4, 0x8e, 0xa9, 0x25,
|
|
0x7d, 0x0a, 0xad, 0x6d, 0x92, 0x26, 0xda, 0x6e, 0x8c, 0x88, 0xdf, 0x63, 0x65, 0xe1, 0xfd, 0x84,
|
|
0xfe, 0x59, 0x8a, 0xab, 0xdd, 0x56, 0x17, 0x5a, 0x9b, 0x50, 0x6d, 0x50, 0xeb, 0x31, 0xc3, 0x9c,
|
|
0xce, 0xc0, 0xe2, 0x5b, 0x9e, 0x72, 0xa1, 0x95, 0x6d, 0x8e, 0x1a, 0xfe, 0xa3, 0xe9, 0x70, 0x52,
|
|
0xd9, 0x9d, 0x5c, 0xf3, 0xe7, 0x25, 0x8e, 0x9d, 0x09, 0xc5, 0xe0, 0x48, 0xee, 0xc4, 0x79, 0x30,
|
|
0x16, 0xde, 0x0c, 0x9e, 0xd5, 0x12, 0x0b, 0xdf, 0x49, 0xb5, 0xb1, 0x99, 0xc4, 0xe8, 0x87, 0x87,
|
|
0x31, 0x6e, 0xd2, 0x65, 0x98, 0x7b, 0x5f, 0xe0, 0xc9, 0x85, 0xfc, 0x7d, 0xc7, 0x95, 0xbe, 0x7d,
|
|
0x2d, 0x1a, 0x40, 0x3b, 0x2f, 0xae, 0x54, 0x59, 0x7f, 0x5e, 0x63, 0xbd, 0xf8, 0xce, 0xee, 0x60,
|
|
0xde, 0x07, 0x18, 0xdc, 0xb3, 0x96, 0x49, 0xa1, 0x38, 0x9d, 0x42, 0x27, 0x47, 0x9b, 0xca, 0x26,
|
|
0xa8, 0x62, 0xdf, 0x3a, 0x00, 0xab, 0x80, 0x63, 0x07, 0xac, 0x79, 0x9e, 0xbf, 0x97, 0x31, 0x57,
|
|
0xb4, 0x0f, 0xf0, 0x49, 0xf0, 0x5f, 0x19, 0x8f, 0x34, 0x8f, 0x07, 0xc6, 0xf4, 0x07, 0xb4, 0x90,
|
|
0x4c, 0xdf, 0x82, 0x55, 0xf1, 0xe9, 0x8b, 0x3a, 0x4d, 0x5c, 0xcf, 0x71, 0x6a, 0xc7, 0x95, 0xde,
|
|
0xc6, 0xd0, 0x5e, 0xe9, 0x9c, 0x87, 0x29, 0xed, 0x5d, 0x50, 0x4b, 0xb5, 0x76, 0xae, 0x4b, 0x9f,
|
|
0xbc, 0x22, 0xef, 0x66, 0x7f, 0x8e, 0x2e, 0x39, 0x1c, 0x5d, 0xf2, 0xef, 0xe8, 0x92, 0xdf, 0x27,
|
|
0xd7, 0x38, 0x9c, 0x5c, 0xe3, 0xef, 0xc9, 0x35, 0x3e, 0xbf, 0x7c, 0xf0, 0xcf, 0xfd, 0xda, 0xc6,
|
|
0xf0, 0xfa, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5a, 0xf6, 0x94, 0x21, 0xe5, 0x02, 0x00, 0x00,
|
|
}
|
|
|
|
func (m *Msg) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *Msg) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *Msg) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.SpaceId) > 0 {
|
|
i -= len(m.SpaceId)
|
|
copy(dAtA[i:], m.SpaceId)
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(len(m.SpaceId)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *HeadSyncRange) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *HeadSyncRange) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *HeadSyncRange) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Limit != 0 {
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(m.Limit))
|
|
i--
|
|
dAtA[i] = 0x18
|
|
}
|
|
if m.To != 0 {
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(m.To))
|
|
i--
|
|
dAtA[i] = 0x10
|
|
}
|
|
if m.From != 0 {
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(m.From))
|
|
i--
|
|
dAtA[i] = 0x8
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *HeadSyncResult) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *HeadSyncResult) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *HeadSyncResult) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if m.Count != 0 {
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(m.Count))
|
|
i--
|
|
dAtA[i] = 0x18
|
|
}
|
|
if len(m.Elements) > 0 {
|
|
for iNdEx := len(m.Elements) - 1; iNdEx >= 0; iNdEx-- {
|
|
{
|
|
size, err := m.Elements[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
}
|
|
if len(m.Hash) > 0 {
|
|
i -= len(m.Hash)
|
|
copy(dAtA[i:], m.Hash)
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(len(m.Hash)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *HeadSyncResultElement) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *HeadSyncResultElement) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *HeadSyncResultElement) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Head) > 0 {
|
|
i -= len(m.Head)
|
|
copy(dAtA[i:], m.Head)
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(len(m.Head)))
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
if len(m.Id) > 0 {
|
|
i -= len(m.Id)
|
|
copy(dAtA[i:], m.Id)
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(len(m.Id)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *HeadSyncRequest) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *HeadSyncRequest) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *HeadSyncRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Ranges) > 0 {
|
|
for iNdEx := len(m.Ranges) - 1; iNdEx >= 0; iNdEx-- {
|
|
{
|
|
size, err := m.Ranges[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0x12
|
|
}
|
|
}
|
|
if len(m.SpaceId) > 0 {
|
|
i -= len(m.SpaceId)
|
|
copy(dAtA[i:], m.SpaceId)
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(len(m.SpaceId)))
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func (m *HeadSyncResponse) Marshal() (dAtA []byte, err error) {
|
|
size := m.Size()
|
|
dAtA = make([]byte, size)
|
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return dAtA[:n], nil
|
|
}
|
|
|
|
func (m *HeadSyncResponse) MarshalTo(dAtA []byte) (int, error) {
|
|
size := m.Size()
|
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
}
|
|
|
|
func (m *HeadSyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
i := len(dAtA)
|
|
_ = i
|
|
var l int
|
|
_ = l
|
|
if len(m.Results) > 0 {
|
|
for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- {
|
|
{
|
|
size, err := m.Results[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
i -= size
|
|
i = encodeVarintSpacesync(dAtA, i, uint64(size))
|
|
}
|
|
i--
|
|
dAtA[i] = 0xa
|
|
}
|
|
}
|
|
return len(dAtA) - i, nil
|
|
}
|
|
|
|
func encodeVarintSpacesync(dAtA []byte, offset int, v uint64) int {
|
|
offset -= sovSpacesync(v)
|
|
base := offset
|
|
for v >= 1<<7 {
|
|
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
v >>= 7
|
|
offset++
|
|
}
|
|
dAtA[offset] = uint8(v)
|
|
return base
|
|
}
|
|
func (m *Msg) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.SpaceId)
|
|
if l > 0 {
|
|
n += 1 + l + sovSpacesync(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *HeadSyncRange) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if m.From != 0 {
|
|
n += 1 + sovSpacesync(uint64(m.From))
|
|
}
|
|
if m.To != 0 {
|
|
n += 1 + sovSpacesync(uint64(m.To))
|
|
}
|
|
if m.Limit != 0 {
|
|
n += 1 + sovSpacesync(uint64(m.Limit))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *HeadSyncResult) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Hash)
|
|
if l > 0 {
|
|
n += 1 + l + sovSpacesync(uint64(l))
|
|
}
|
|
if len(m.Elements) > 0 {
|
|
for _, e := range m.Elements {
|
|
l = e.Size()
|
|
n += 1 + l + sovSpacesync(uint64(l))
|
|
}
|
|
}
|
|
if m.Count != 0 {
|
|
n += 1 + sovSpacesync(uint64(m.Count))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *HeadSyncResultElement) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.Id)
|
|
if l > 0 {
|
|
n += 1 + l + sovSpacesync(uint64(l))
|
|
}
|
|
l = len(m.Head)
|
|
if l > 0 {
|
|
n += 1 + l + sovSpacesync(uint64(l))
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *HeadSyncRequest) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
l = len(m.SpaceId)
|
|
if l > 0 {
|
|
n += 1 + l + sovSpacesync(uint64(l))
|
|
}
|
|
if len(m.Ranges) > 0 {
|
|
for _, e := range m.Ranges {
|
|
l = e.Size()
|
|
n += 1 + l + sovSpacesync(uint64(l))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (m *HeadSyncResponse) Size() (n int) {
|
|
if m == nil {
|
|
return 0
|
|
}
|
|
var l int
|
|
_ = l
|
|
if len(m.Results) > 0 {
|
|
for _, e := range m.Results {
|
|
l = e.Size()
|
|
n += 1 + l + sovSpacesync(uint64(l))
|
|
}
|
|
}
|
|
return n
|
|
}
|
|
|
|
func sovSpacesync(x uint64) (n int) {
|
|
return (math_bits.Len64(x|1) + 6) / 7
|
|
}
|
|
func sozSpacesync(x uint64) (n int) {
|
|
return sovSpacesync(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
}
|
|
func (m *Msg) Unmarshal(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 ErrIntOverflowSpacesync
|
|
}
|
|
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: Msg: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: Msg: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
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 ErrInvalidLengthSpacesync
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.SpaceId = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipSpacesync(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *HeadSyncRange) Unmarshal(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 ErrIntOverflowSpacesync
|
|
}
|
|
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: HeadSyncRange: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: HeadSyncRange: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
|
|
}
|
|
m.From = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.From |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 2:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field To", wireType)
|
|
}
|
|
m.To = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.To |= uint64(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
case 3:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Limit", wireType)
|
|
}
|
|
m.Limit = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Limit |= uint32(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipSpacesync(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *HeadSyncResult) Unmarshal(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 ErrIntOverflowSpacesync
|
|
}
|
|
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: HeadSyncResult: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: HeadSyncResult: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType)
|
|
}
|
|
var byteLen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
byteLen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if byteLen < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
postIndex := iNdEx + byteLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...)
|
|
if m.Hash == nil {
|
|
m.Hash = []byte{}
|
|
}
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Elements", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Elements = append(m.Elements, &HeadSyncResultElement{})
|
|
if err := m.Elements[len(m.Elements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
case 3:
|
|
if wireType != 0 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType)
|
|
}
|
|
m.Count = 0
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
m.Count |= uint32(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipSpacesync(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *HeadSyncResultElement) Unmarshal(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 ErrIntOverflowSpacesync
|
|
}
|
|
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: HeadSyncResultElement: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: HeadSyncResultElement: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
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 ErrInvalidLengthSpacesync
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Id = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
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 ErrInvalidLengthSpacesync
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Head = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipSpacesync(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *HeadSyncRequest) Unmarshal(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 ErrIntOverflowSpacesync
|
|
}
|
|
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: HeadSyncRequest: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: HeadSyncRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType)
|
|
}
|
|
var stringLen uint64
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
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 ErrInvalidLengthSpacesync
|
|
}
|
|
postIndex := iNdEx + intStringLen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.SpaceId = string(dAtA[iNdEx:postIndex])
|
|
iNdEx = postIndex
|
|
case 2:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Ranges", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Ranges = append(m.Ranges, &HeadSyncRange{})
|
|
if err := m.Ranges[len(m.Ranges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipSpacesync(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func (m *HeadSyncResponse) Unmarshal(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 ErrIntOverflowSpacesync
|
|
}
|
|
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: HeadSyncResponse: wiretype end group for non-group")
|
|
}
|
|
if fieldNum <= 0 {
|
|
return fmt.Errorf("proto: HeadSyncResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
}
|
|
switch fieldNum {
|
|
case 1:
|
|
if wireType != 2 {
|
|
return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType)
|
|
}
|
|
var msglen int
|
|
for shift := uint(0); ; shift += 7 {
|
|
if shift >= 64 {
|
|
return ErrIntOverflowSpacesync
|
|
}
|
|
if iNdEx >= l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
b := dAtA[iNdEx]
|
|
iNdEx++
|
|
msglen |= int(b&0x7F) << shift
|
|
if b < 0x80 {
|
|
break
|
|
}
|
|
}
|
|
if msglen < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
postIndex := iNdEx + msglen
|
|
if postIndex < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if postIndex > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
m.Results = append(m.Results, &HeadSyncResult{})
|
|
if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
return err
|
|
}
|
|
iNdEx = postIndex
|
|
default:
|
|
iNdEx = preIndex
|
|
skippy, err := skipSpacesync(dAtA[iNdEx:])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
return ErrInvalidLengthSpacesync
|
|
}
|
|
if (iNdEx + skippy) > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
iNdEx += skippy
|
|
}
|
|
}
|
|
|
|
if iNdEx > l {
|
|
return io.ErrUnexpectedEOF
|
|
}
|
|
return nil
|
|
}
|
|
func skipSpacesync(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, ErrIntOverflowSpacesync
|
|
}
|
|
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, ErrIntOverflowSpacesync
|
|
}
|
|
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, ErrIntOverflowSpacesync
|
|
}
|
|
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, ErrInvalidLengthSpacesync
|
|
}
|
|
iNdEx += length
|
|
case 3:
|
|
depth++
|
|
case 4:
|
|
if depth == 0 {
|
|
return 0, ErrUnexpectedEndOfGroupSpacesync
|
|
}
|
|
depth--
|
|
case 5:
|
|
iNdEx += 4
|
|
default:
|
|
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
}
|
|
if iNdEx < 0 {
|
|
return 0, ErrInvalidLengthSpacesync
|
|
}
|
|
if depth == 0 {
|
|
return iNdEx, nil
|
|
}
|
|
}
|
|
return 0, io.ErrUnexpectedEOF
|
|
}
|
|
|
|
var (
|
|
ErrInvalidLengthSpacesync = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
ErrIntOverflowSpacesync = fmt.Errorf("proto: integer overflow")
|
|
ErrUnexpectedEndOfGroupSpacesync = fmt.Errorf("proto: unexpected end of group")
|
|
)
|