Documentation ¶
Index ¶
- type CollectiveError
- type Node
- func (n *Node) CloseConnection(connID connection.ID, transportOptions transport.Options) error
- func (n *Node) Connect(receiver peer.Peer, connOptions connection.Options, ...) (connection.ID, error)
- func (n *Node) Connections() ([]connection.Connection, error)
- func (n *Node) Peers() ([]peer.Peer, error)
- func (n *Node) RequestPeers(p peer.Peer, request peer.PeersRequest, options transport.Options) ([]peer.Peer, error)
- func (n *Node) Self() (peer.Peer, error)
- func (n *Node) UpdatePeer(peer peer.Peer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectiveError ¶
type CollectiveError struct {
Errs []error
}
func (*CollectiveError) Error ¶
func (e *CollectiveError) Error() string
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func NewNode ¶
func NewNode( peerStore peer.PeerStore, connectionStore connection.ConnectionStore, messageStore data.MessageStore, reputationStore reputation.ReputationStore, trustFunc reputation.TrustFunction, transport transport.Transport, handlers transport.Handlers, log log.Logger, ) (*Node, error)
func (*Node) CloseConnection ¶
func (*Node) Connect ¶
func (n *Node) Connect(receiver peer.Peer, connOptions connection.Options, transportOptions transport.Options) (connection.ID, error)
Connect establishes an outgoing connection to the specified peer and attempts to set up the connection as far as possible.
func (*Node) Connections ¶
func (n *Node) Connections() ([]connection.Connection, error)
Connections returns a read only view of all the conncetions in the node's peerstore
func (*Node) RequestPeers ¶
func (*Node) UpdatePeer ¶
UpdatePeer updates the peer within the PeerStore. If the peer does not yet exist, it will add the peer to the peer store.
This operation does not guarantee atomicity so modifications may have been made even if an error is returned.
Click to show internal directories.
Click to hide internal directories.