Documentation ¶
Index ¶
Constants ¶
const (
PacketIDBootstrapInfo byte = 240
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InfoRequestPacket ¶
type InfoRequestPacket struct{}
InfoRequestPacket represents the structure of the packet used to request info from a bootstrap node. It contains infoRequestPacketLength - 1 useless bytes.
func (InfoRequestPacket) ID ¶
func (p InfoRequestPacket) ID() byte
ID returns the packet ID of this packet.
func (*InfoRequestPacket) MarshalBinary ¶
func (p *InfoRequestPacket) MarshalBinary() ([]byte, error)
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*InfoRequestPacket) UnmarshalBinary ¶
func (p *InfoRequestPacket) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
type InfoResponsePacket ¶
InfoResponsePacket represents the structure of a packet that is sent in response to a bootstrap node info request.
func (InfoResponsePacket) ID ¶
func (p InfoResponsePacket) ID() byte
ID returns the packet ID of this packet.
func (*InfoResponsePacket) MarshalBinary ¶
func (p *InfoResponsePacket) MarshalBinary() ([]byte, error)
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*InfoResponsePacket) UnmarshalBinary ¶
func (p *InfoResponsePacket) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
type Node ¶
type Node struct { Ident *dht.Ident Info *NodeInfo IsBootstrap bool // contains filtered or unexported fields }
func (*Node) Pings ¶
func (n *Node) Pings() *ping.Collection
type Packet ¶
Packet represents the base of all bootstrap node packets.
func (*Packet) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*Packet) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.