Unverified Commit 60bf479c authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #27 from libp2p/chore/update-deps

chore(dep): update
parents afa9793b d580e860
This diff is collapsed.
......@@ -8,6 +8,7 @@ import (
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.
......@@ -19,7 +20,7 @@ var _ = math.Inf
// 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
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Message_MessageType int32
......@@ -133,7 +134,7 @@ func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Message.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
......@@ -195,7 +196,7 @@ func (m *Message_PeerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
return xxx_messageInfo_Message_PeerInfo.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
......@@ -249,7 +250,7 @@ func (m *Message_Dial) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return xxx_messageInfo_Message_Dial.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
......@@ -298,7 +299,7 @@ func (m *Message_DialResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte
return xxx_messageInfo_Message_DialResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
......@@ -380,7 +381,7 @@ var fileDescriptor_a04e278ef61ac07a = []byte{
func (m *Message) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
......@@ -388,45 +389,55 @@ func (m *Message) Marshal() (dAtA []byte, err error) {
}
func (m *Message) MarshalTo(dAtA []byte) (int, error) {
var i int
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Type != nil {
dAtA[i] = 0x8
i++
i = encodeVarintAutonat(dAtA, i, uint64(*m.Type))
}
if m.Dial != nil {
dAtA[i] = 0x12
i++
i = encodeVarintAutonat(dAtA, i, uint64(m.Dial.Size()))
n1, err := m.Dial.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n1
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.DialResponse != nil {
{
size, err := m.DialResponse.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintAutonat(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
i++
i = encodeVarintAutonat(dAtA, i, uint64(m.DialResponse.Size()))
n2, err := m.DialResponse.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
if m.Dial != nil {
{
size, err := m.Dial.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintAutonat(dAtA, i, uint64(size))
}
i += n2
i--
dAtA[i] = 0x12
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
if m.Type != nil {
i = encodeVarintAutonat(dAtA, i, uint64(*m.Type))
i--
dAtA[i] = 0x8
}
return i, nil
return len(dAtA) - i, nil
}
func (m *Message_PeerInfo) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
......@@ -434,34 +445,42 @@ func (m *Message_PeerInfo) Marshal() (dAtA []byte, err error) {
}
func (m *Message_PeerInfo) MarshalTo(dAtA []byte) (int, error) {
var i int
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Message_PeerInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Id != nil {
dAtA[i] = 0xa
i++
i = encodeVarintAutonat(dAtA, i, uint64(len(m.Id)))
i += copy(dAtA[i:], m.Id)
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if len(m.Addrs) > 0 {
for _, b := range m.Addrs {
for iNdEx := len(m.Addrs) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Addrs[iNdEx])
copy(dAtA[i:], m.Addrs[iNdEx])
i = encodeVarintAutonat(dAtA, i, uint64(len(m.Addrs[iNdEx])))
i--
dAtA[i] = 0x12
i++
i = encodeVarintAutonat(dAtA, i, uint64(len(b)))
i += copy(dAtA[i:], b)
}
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
if m.Id != nil {
i -= len(m.Id)
copy(dAtA[i:], m.Id)
i = encodeVarintAutonat(dAtA, i, uint64(len(m.Id)))
i--
dAtA[i] = 0xa
}
return i, nil
return len(dAtA) - i, nil
}
func (m *Message_Dial) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
......@@ -469,30 +488,38 @@ func (m *Message_Dial) Marshal() (dAtA []byte, err error) {
}
func (m *Message_Dial) MarshalTo(dAtA []byte) (int, error) {
var i int
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Message_Dial) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.Peer != nil {
dAtA[i] = 0xa
i++
i = encodeVarintAutonat(dAtA, i, uint64(m.Peer.Size()))
n3, err := m.Peer.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
{
size, err := m.Peer.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintAutonat(dAtA, i, uint64(size))
}
i += n3
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
i--
dAtA[i] = 0xa
}
return i, nil
return len(dAtA) - i, nil
}
func (m *Message_DialResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
......@@ -500,41 +527,51 @@ func (m *Message_DialResponse) Marshal() (dAtA []byte, err error) {
}
func (m *Message_DialResponse) MarshalTo(dAtA []byte) (int, error) {
var i int
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Message_DialResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Status != nil {
dAtA[i] = 0x8
i++
i = encodeVarintAutonat(dAtA, i, uint64(*m.Status))
}
if m.StatusText != nil {
dAtA[i] = 0x12
i++
i = encodeVarintAutonat(dAtA, i, uint64(len(*m.StatusText)))
i += copy(dAtA[i:], *m.StatusText)
if m.XXX_unrecognized != nil {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.Addr != nil {
dAtA[i] = 0x1a
i++
i -= len(m.Addr)
copy(dAtA[i:], m.Addr)
i = encodeVarintAutonat(dAtA, i, uint64(len(m.Addr)))
i += copy(dAtA[i:], m.Addr)
i--
dAtA[i] = 0x1a
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
if m.StatusText != nil {
i -= len(*m.StatusText)
copy(dAtA[i:], *m.StatusText)
i = encodeVarintAutonat(dAtA, i, uint64(len(*m.StatusText)))
i--
dAtA[i] = 0x12
}
return i, nil
if m.Status != nil {
i = encodeVarintAutonat(dAtA, i, uint64(*m.Status))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}
func encodeVarintAutonat(dAtA []byte, offset int, v uint64) int {
offset -= sovAutonat(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
return base
}
func (m *Message) Size() (n int) {
if m == nil {
......@@ -621,14 +658,7 @@ func (m *Message_DialResponse) Size() (n int) {
}
func sovAutonat(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
return (math_bits.Len64(x|1) + 6) / 7
}
func sozAutonat(x uint64) (n int) {
return sovAutonat(uint64((x << 1) ^ uint64((int64(x) >> 63))))
......@@ -1133,6 +1163,7 @@ func (m *Message_DialResponse) Unmarshal(dAtA []byte) error {
func skipAutonat(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 {
......@@ -1164,10 +1195,8 @@ func skipAutonat(dAtA []byte) (n int, err error) {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
......@@ -1191,52 +1220,27 @@ func skipAutonat(dAtA []byte) (n int, err error) {
if iNdEx < 0 {
return 0, ErrInvalidLengthAutonat
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowAutonat
}
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 := skipAutonat(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthAutonat
}
}
return iNdEx, nil
depth++
case 4:
return iNdEx, nil
if depth == 0 {
return 0, ErrUnexpectedEndOfGroupAutonat
}
depth--
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if depth == 0 {
return iNdEx, nil
}
}
panic("unreachable")
return 0, io.ErrUnexpectedEOF
}
var (
ErrInvalidLengthAutonat = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowAutonat = fmt.Errorf("proto: integer overflow")
ErrInvalidLengthAutonat = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowAutonat = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupAutonat = fmt.Errorf("proto: unexpected end of group")
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment