Versions in this module Expand all Collapse all v0 v0.29.0 Jul 29, 2023 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 NewHost2(n network.Network, netDriver NativeNetDriver, 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) NormalizeMultiaddr(addr ma.Multiaddr) ma.Multiaddr + 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(protocol.ID) bool, handler network.StreamHandler) + func (h *BasicHost) SignalAddressChange() + func (h *BasicHost) Start() + type HostOpts struct + AddrsFactory AddrsFactory + ConnManager connmgr.ConnManager + DisableSignedPeerRecord bool + EnableHolePunching bool + EnableMetrics bool + EnablePing bool + EnableRelayService bool + EventBus event.Bus + HolePunchingOptions []holepunch.Option + MultiaddrResolver *madns.Resolver + MultistreamMuxer *msmux.MultistreamMuxer[protocol.ID] + NATManager func(network.Network) NATManager + NegotiationTimeout time.Duration + PrometheusRegisterer prometheus.Registerer + ProtocolVersion string + RelayServiceOpts []relayv2.Option + UserAgent string + type NATManager interface + GetMapping func(ma.Multiaddr) ma.Multiaddr + HasDiscoveredNAT func() bool + func NewNATManager(net network.Network) NATManager + type NativeNetDriver interface + InterfaceAddrs func() ([]net.Addr, error) + Interfaces func() ([]net.Interface, error)