Versions in this module Expand all Collapse all v0 v0.23.5 Nov 8, 2022 Changes in this version + var DefaultAddrsFactory = func(addrs []ma.Multiaddr) []ma.Multiaddr + var DefaultNegotiationTimeout = 10 * time.Second + type AddrsFactory func([]ma.Multiaddr) []ma.Multiaddr + type BasicHost struct + AddrsFactory AddrsFactory + func NewHost(n network.Network, opts *HostOpts) (*BasicHost, error) + func (h *BasicHost) Addrs() []ma.Multiaddr + func (h *BasicHost) AllAddrs() []ma.Multiaddr + func (h *BasicHost) Close() error + func (h *BasicHost) ConnManager() connmgr.ConnManager + func (h *BasicHost) Connect(ctx context.Context, pi peer.AddrInfo) error + func (h *BasicHost) EventBus() event.Bus + func (h *BasicHost) GetAutoNat() autonat.AutoNAT + func (h *BasicHost) ID() peer.ID + func (h *BasicHost) IDService() identify.IDService + func (h *BasicHost) Mux() protocol.Switch + func (h *BasicHost) Network() network.Network + func (h *BasicHost) NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error) + func (h *BasicHost) Peerstore() peerstore.Peerstore + func (h *BasicHost) RemoveStreamHandler(pid protocol.ID) + func (h *BasicHost) SetAutoNat(a autonat.AutoNAT) + func (h *BasicHost) SetStreamHandler(pid protocol.ID, handler network.StreamHandler) + func (h *BasicHost) SetStreamHandlerMatch(pid protocol.ID, m func(string) bool, handler network.StreamHandler) + func (h *BasicHost) SignalAddressChange() + func (h *BasicHost) Start() + type HostOpts struct + AddrsFactory AddrsFactory + ConnManager connmgr.ConnManager + DisableSignedPeerRecord bool + EnableHolePunching bool + EnablePing bool + EnableRelayService bool + HolePunchingOptions []holepunch.Option + MultiaddrResolver *madns.Resolver + MultistreamMuxer *msmux.MultistreamMuxer + NATManager func(network.Network) NATManager + NegotiationTimeout time.Duration + ProtocolVersion string + RelayServiceOpts []relayv2.Option + UserAgent string + type NATManager interface + NAT func() *inat.NAT + Ready func() <-chan struct{} + func NewNATManager(net network.Network) NATManager