Documentation
¶
Overview ¶
Package network provides threaded P2P functionality for sending Messages wrapped in the bitmsg header.
Index ¶
Constants ¶
const ( ENTFND = iota EPRDUP = iota )
Error constants for PeerError
Error constants for MessageError
Variables ¶
This section is empty.
Functions ¶
func ConnectToPeer ¶
ConnectToPeer adds the provided peer to the peerlist, or just connects to it if it already exists. Duplicate connected peers are not allowed.
Types ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message holds a standard, serializeable BitMsg message header and generic payload. See more info at https://bitmessage.org/wiki/Protocol_specification#Message_structure
func MakeMessage ¶
func MakeMessage(cmd string, pload types.Serializer, recipient *Peer) *Message
MakeMessage generates a new message given a command, payload, and recipient. No defensive copy is made of the byte slice
type MessageError ¶
type MessageError int
MessageError handles all errors associated with the Message struct.
func (MessageError) Error ¶
func (errno MessageError) Error() string
Error converts the MessageError constant to a human-readable string
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
Peer represents and holds connection information for an external connection specified by a hostname/port combination.
func GetPeer ¶
GetPeer checks the peer list to see if a peer exists under a hostname. It then returns that peer.
func (*Peer) IsConnected ¶
IsConnected returns the connection status of the peer