Versions in this module Expand all Collapse all v0 v0.0.2 Oct 11, 2021 v0.0.1 Oct 11, 2021 Changes in this version + type Listener interface + ListenAddress func() ma.Multiaddr + Protocol func() protocol.ID + TargetAddress func() ma.Multiaddr + type Listeners struct + Listeners map[string]Listener + func (r *Listeners) Close(matchFunc func(listener Listener) bool) int + func (r *Listeners) Register(l Listener) error + type P2P struct + ListenersLocal *Listeners + ListenersP2P *Listeners + Streams *StreamRegistry + func New(identity peer.ID, peerHost p2phost.Host, peerstore pstore.Peerstore) *P2P + func (p2p *P2P) CheckProtoExists(proto string) bool + func (p2p *P2P) ForwardLocal(ctx context.Context, peer peer.ID, proto protocol.ID, bindAddr ma.Multiaddr) (Listener, error) + func (p2p *P2P) ForwardRemote(ctx context.Context, proto protocol.ID, addr ma.Multiaddr, reportRemote bool) (Listener, error) + type Stream struct + Local manet.Conn + OriginAddr ma.Multiaddr + Protocol protocol.ID + Registry *StreamRegistry + Remote net.Stream + TargetAddr ma.Multiaddr + type StreamRegistry struct + Streams map[uint64]*Stream + func (r *StreamRegistry) Close(s *Stream) + func (r *StreamRegistry) Deregister(streamID uint64) + func (r *StreamRegistry) Register(streamInfo *Stream) + func (r *StreamRegistry) Reset(s *Stream)