Documentation ¶
Index ¶
- Variables
- type Network
- func (n *Network) AddrInfo() peer.AddrInfo
- func (n *Network) Connect(p peer.AddrInfo) error
- func (n *Network) Messages() <-chan []byte
- func (n *Network) MultiAddrs() []string
- func (n *Network) PeerID() peer.ID
- func (n *Network) Peers() []peer.ID
- func (n *Network) Publish(ctx context.Context, data []byte) error
- func (n *Network) RegisterStreamHandler(id core.ProtocolID, handler network.StreamHandler)
- func (n *Network) Send(ctx context.Context, protocol core.ProtocolID, p peer.ID, data []byte) error
- func (n *Network) Start() error
- func (n *Network) Stop() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNilHost = errors.New("host is nil")
ErrNilHost is returned when trying to instantiate a network with a nil host
Functions ¶
This section is empty.
Types ¶
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Host wraps a libp2p host. It contains the current pubsub state. Host implements the Network interface
func (*Network) MultiAddrs ¶
func (*Network) RegisterStreamHandler ¶
func (n *Network) RegisterStreamHandler(id core.ProtocolID, handler network.StreamHandler)
RegisterStreamHandler registers a handler and protocol ID on the libp2p host
Click to show internal directories.
Click to hide internal directories.