v2

package
v0.0.0-...-c01ea1d Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 (n *Node) CloseConnection(connID connection.ID, transportOptions transport.Options) error

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) Peers

func (n *Node) Peers() ([]peer.Peer, error)

func (*Node) RequestPeers

func (n *Node) RequestPeers(p peer.Peer, request peer.PeersRequest, options transport.Options) ([]peer.Peer, error)

func (*Node) Self

func (n *Node) Self() (peer.Peer, error)

func (*Node) UpdatePeer

func (n *Node) UpdatePeer(peer peer.Peer) error

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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