go-libp2p-core/routing/pb/routing_state.pb.go
2020-01-17 10:42:26 -05:00

611 lines
15 KiB
Go

// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: routing_state.proto
package routing_pb
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
)
// 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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type RoutingStateRecord struct {
PeerId []byte `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
Seq uint64 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"`
Addresses []*RoutingStateRecord_AddressInfo `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty"`
}
func (m *RoutingStateRecord) Reset() { *m = RoutingStateRecord{} }
func (m *RoutingStateRecord) String() string { return proto.CompactTextString(m) }
func (*RoutingStateRecord) ProtoMessage() {}
func (*RoutingStateRecord) Descriptor() ([]byte, []int) {
return fileDescriptor_2bc7f62bc26d3acc, []int{0}
}
func (m *RoutingStateRecord) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *RoutingStateRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_RoutingStateRecord.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *RoutingStateRecord) XXX_Merge(src proto.Message) {
xxx_messageInfo_RoutingStateRecord.Merge(m, src)
}
func (m *RoutingStateRecord) XXX_Size() int {
return m.Size()
}
func (m *RoutingStateRecord) XXX_DiscardUnknown() {
xxx_messageInfo_RoutingStateRecord.DiscardUnknown(m)
}
var xxx_messageInfo_RoutingStateRecord proto.InternalMessageInfo
func (m *RoutingStateRecord) GetPeerId() []byte {
if m != nil {
return m.PeerId
}
return nil
}
func (m *RoutingStateRecord) GetSeq() uint64 {
if m != nil {
return m.Seq
}
return 0
}
func (m *RoutingStateRecord) GetAddresses() []*RoutingStateRecord_AddressInfo {
if m != nil {
return m.Addresses
}
return nil
}
type RoutingStateRecord_AddressInfo struct {
Multiaddr []byte `protobuf:"bytes,1,opt,name=multiaddr,proto3" json:"multiaddr,omitempty"`
}
func (m *RoutingStateRecord_AddressInfo) Reset() { *m = RoutingStateRecord_AddressInfo{} }
func (m *RoutingStateRecord_AddressInfo) String() string { return proto.CompactTextString(m) }
func (*RoutingStateRecord_AddressInfo) ProtoMessage() {}
func (*RoutingStateRecord_AddressInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_2bc7f62bc26d3acc, []int{0, 0}
}
func (m *RoutingStateRecord_AddressInfo) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *RoutingStateRecord_AddressInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_RoutingStateRecord_AddressInfo.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *RoutingStateRecord_AddressInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_RoutingStateRecord_AddressInfo.Merge(m, src)
}
func (m *RoutingStateRecord_AddressInfo) XXX_Size() int {
return m.Size()
}
func (m *RoutingStateRecord_AddressInfo) XXX_DiscardUnknown() {
xxx_messageInfo_RoutingStateRecord_AddressInfo.DiscardUnknown(m)
}
var xxx_messageInfo_RoutingStateRecord_AddressInfo proto.InternalMessageInfo
func (m *RoutingStateRecord_AddressInfo) GetMultiaddr() []byte {
if m != nil {
return m.Multiaddr
}
return nil
}
func init() {
proto.RegisterType((*RoutingStateRecord)(nil), "routing.pb.RoutingStateRecord")
proto.RegisterType((*RoutingStateRecord_AddressInfo)(nil), "routing.pb.RoutingStateRecord.AddressInfo")
}
func init() { proto.RegisterFile("routing_state.proto", fileDescriptor_2bc7f62bc26d3acc) }
var fileDescriptor_2bc7f62bc26d3acc = []byte{
// 200 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2e, 0xca, 0x2f, 0x2d,
0xc9, 0xcc, 0x4b, 0x8f, 0x2f, 0x2e, 0x49, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
0xe2, 0x82, 0x0a, 0xea, 0x15, 0x24, 0x29, 0x6d, 0x63, 0xe4, 0x12, 0x0a, 0x82, 0x70, 0x83, 0x41,
0x4a, 0x82, 0x52, 0x93, 0xf3, 0x8b, 0x52, 0x84, 0xc4, 0xb9, 0xd8, 0x0b, 0x52, 0x53, 0x8b, 0xe2,
0x33, 0x53, 0x24, 0x18, 0x15, 0x18, 0x35, 0x78, 0x82, 0xd8, 0x40, 0x5c, 0xcf, 0x14, 0x21, 0x01,
0x2e, 0xe6, 0xe2, 0xd4, 0x42, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x96, 0x20, 0x10, 0x53, 0xc8, 0x83,
0x8b, 0x33, 0x31, 0x25, 0xa5, 0x28, 0xb5, 0xb8, 0x38, 0xb5, 0x58, 0x82, 0x59, 0x81, 0x59, 0x83,
0xdb, 0x48, 0x4b, 0x0f, 0x61, 0x83, 0x1e, 0xa6, 0xe9, 0x7a, 0x8e, 0x10, 0xf5, 0x9e, 0x79, 0x69,
0xf9, 0x41, 0x08, 0xcd, 0x52, 0xda, 0x5c, 0xdc, 0x48, 0x32, 0x42, 0x32, 0x5c, 0x9c, 0xb9, 0xa5,
0x39, 0x25, 0x99, 0x20, 0x05, 0x50, 0x57, 0x20, 0x04, 0x9c, 0x24, 0x4e, 0x3c, 0x92, 0x63, 0xbc,
0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63,
0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x89, 0x0d, 0xec, 0x4b, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff,
0xdc, 0xd5, 0x32, 0xa1, 0xfc, 0x00, 0x00, 0x00,
}
func (m *RoutingStateRecord) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *RoutingStateRecord) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.PeerId) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintRoutingState(dAtA, i, uint64(len(m.PeerId)))
i += copy(dAtA[i:], m.PeerId)
}
if m.Seq != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintRoutingState(dAtA, i, uint64(m.Seq))
}
if len(m.Addresses) > 0 {
for _, msg := range m.Addresses {
dAtA[i] = 0x1a
i++
i = encodeVarintRoutingState(dAtA, i, uint64(msg.Size()))
n, err := msg.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n
}
}
return i, nil
}
func (m *RoutingStateRecord_AddressInfo) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *RoutingStateRecord_AddressInfo) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.Multiaddr) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintRoutingState(dAtA, i, uint64(len(m.Multiaddr)))
i += copy(dAtA[i:], m.Multiaddr)
}
return i, nil
}
func encodeVarintRoutingState(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *RoutingStateRecord) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.PeerId)
if l > 0 {
n += 1 + l + sovRoutingState(uint64(l))
}
if m.Seq != 0 {
n += 1 + sovRoutingState(uint64(m.Seq))
}
if len(m.Addresses) > 0 {
for _, e := range m.Addresses {
l = e.Size()
n += 1 + l + sovRoutingState(uint64(l))
}
}
return n
}
func (m *RoutingStateRecord_AddressInfo) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Multiaddr)
if l > 0 {
n += 1 + l + sovRoutingState(uint64(l))
}
return n
}
func sovRoutingState(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozRoutingState(x uint64) (n int) {
return sovRoutingState(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *RoutingStateRecord) 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 ErrIntOverflowRoutingState
}
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: RoutingStateRecord: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: RoutingStateRecord: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field PeerId", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoutingState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthRoutingState
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthRoutingState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.PeerId = append(m.PeerId[:0], dAtA[iNdEx:postIndex]...)
if m.PeerId == nil {
m.PeerId = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Seq", wireType)
}
m.Seq = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoutingState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Seq |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoutingState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthRoutingState
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthRoutingState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Addresses = append(m.Addresses, &RoutingStateRecord_AddressInfo{})
if err := m.Addresses[len(m.Addresses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipRoutingState(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthRoutingState
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthRoutingState
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *RoutingStateRecord_AddressInfo) 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 ErrIntOverflowRoutingState
}
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: AddressInfo: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: AddressInfo: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Multiaddr", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRoutingState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return ErrInvalidLengthRoutingState
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthRoutingState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Multiaddr = append(m.Multiaddr[:0], dAtA[iNdEx:postIndex]...)
if m.Multiaddr == nil {
m.Multiaddr = []byte{}
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipRoutingState(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthRoutingState
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthRoutingState
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipRoutingState(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowRoutingState
}
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, ErrIntOverflowRoutingState
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowRoutingState
}
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, ErrInvalidLengthRoutingState
}
iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthRoutingState
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowRoutingState
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipRoutingState(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthRoutingState
}
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthRoutingState = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowRoutingState = fmt.Errorf("proto: integer overflow")
)