peer_pb

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthPeerRecord        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPeerRecord          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPeerRecord = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type PeerRecord

type PeerRecord struct {
	// peer_id contains a libp2p peer id in its binary representation.
	PeerId []byte `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	// seq contains a monotonically-increasing sequence counter to order PeerRecords in time.
	Seq uint64 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"`
	// addresses is a list of public listen addresses for the peer.
	Addresses []*PeerRecord_AddressInfo `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty"`
}

PeerRecord messages contain information that is useful to share with other peers. Currently, a PeerRecord contains the public listen addresses for a peer, but this is expected to expand to include other information in the future.

PeerRecords are designed to be serialized to bytes and placed inside of SignedEnvelopes before sharing with other peers. See https://github.com/libp2p/go-libp2p/core/record/pb/envelope.proto for the SignedEnvelope definition.

func (*PeerRecord) Descriptor

func (*PeerRecord) Descriptor() ([]byte, []int)

func (*PeerRecord) GetAddresses

func (m *PeerRecord) GetAddresses() []*PeerRecord_AddressInfo

func (*PeerRecord) GetPeerId

func (m *PeerRecord) GetPeerId() []byte

func (*PeerRecord) GetSeq

func (m *PeerRecord) GetSeq() uint64

func (*PeerRecord) Marshal

func (m *PeerRecord) Marshal() (dAtA []byte, err error)

func (*PeerRecord) MarshalTo

func (m *PeerRecord) MarshalTo(dAtA []byte) (int, error)

func (*PeerRecord) MarshalToSizedBuffer

func (m *PeerRecord) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PeerRecord) ProtoMessage

func (*PeerRecord) ProtoMessage()

func (*PeerRecord) Reset

func (m *PeerRecord) Reset()

func (*PeerRecord) Size

func (m *PeerRecord) Size() (n int)

func (*PeerRecord) String

func (m *PeerRecord) String() string

func (*PeerRecord) Unmarshal

func (m *PeerRecord) Unmarshal(dAtA []byte) error

func (*PeerRecord) XXX_DiscardUnknown

func (m *PeerRecord) XXX_DiscardUnknown()

func (*PeerRecord) XXX_Marshal

func (m *PeerRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerRecord) XXX_Merge

func (m *PeerRecord) XXX_Merge(src proto.Message)

func (*PeerRecord) XXX_Size

func (m *PeerRecord) XXX_Size() int

func (*PeerRecord) XXX_Unmarshal

func (m *PeerRecord) XXX_Unmarshal(b []byte) error

type PeerRecord_AddressInfo

type PeerRecord_AddressInfo struct {
	Multiaddr []byte `protobuf:"bytes,1,opt,name=multiaddr,proto3" json:"multiaddr,omitempty"`
}

AddressInfo is a wrapper around a binary multiaddr. It is defined as a separate message to allow us to add per-address metadata in the future.

func (*PeerRecord_AddressInfo) Descriptor

func (*PeerRecord_AddressInfo) Descriptor() ([]byte, []int)

func (*PeerRecord_AddressInfo) GetMultiaddr

func (m *PeerRecord_AddressInfo) GetMultiaddr() []byte

func (*PeerRecord_AddressInfo) Marshal

func (m *PeerRecord_AddressInfo) Marshal() (dAtA []byte, err error)

func (*PeerRecord_AddressInfo) MarshalTo

func (m *PeerRecord_AddressInfo) MarshalTo(dAtA []byte) (int, error)

func (*PeerRecord_AddressInfo) MarshalToSizedBuffer

func (m *PeerRecord_AddressInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PeerRecord_AddressInfo) ProtoMessage

func (*PeerRecord_AddressInfo) ProtoMessage()

func (*PeerRecord_AddressInfo) Reset

func (m *PeerRecord_AddressInfo) Reset()

func (*PeerRecord_AddressInfo) Size

func (m *PeerRecord_AddressInfo) Size() (n int)

func (*PeerRecord_AddressInfo) String

func (m *PeerRecord_AddressInfo) String() string

func (*PeerRecord_AddressInfo) Unmarshal

func (m *PeerRecord_AddressInfo) Unmarshal(dAtA []byte) error

func (*PeerRecord_AddressInfo) XXX_DiscardUnknown

func (m *PeerRecord_AddressInfo) XXX_DiscardUnknown()

func (*PeerRecord_AddressInfo) XXX_Marshal

func (m *PeerRecord_AddressInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerRecord_AddressInfo) XXX_Merge

func (m *PeerRecord_AddressInfo) XXX_Merge(src proto.Message)

func (*PeerRecord_AddressInfo) XXX_Size

func (m *PeerRecord_AddressInfo) XXX_Size() int

func (*PeerRecord_AddressInfo) XXX_Unmarshal

func (m *PeerRecord_AddressInfo) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL