Versions in this module Expand all Collapse all v0 v0.29.0 Jul 29, 2023 Changes in this version + const DirectDialEvtT + const EndHolePunchEvtT + const HolePunchAttemptEvtT + const Protocol + const ProtocolErrorEvtT + const ServiceName + const StartHolePunchEvtT + var ErrClosed = errors.New("hole punching service closing") + var ErrHolePunchActive = errors.New("another hole punching attempt to this peer is active") + var StreamTimeout = 1 * time.Minute + type AddrFilter interface + FilterLocal func(remoteID peer.ID, maddrs []ma.Multiaddr) []ma.Multiaddr + FilterRemote func(remoteID peer.ID, maddrs []ma.Multiaddr) []ma.Multiaddr + type DirectDialEvt struct + EllapsedTime time.Duration + Error string + Success bool + type EndHolePunchEvt struct + EllapsedTime time.Duration + Error string + Success bool + type Event struct + Evt interface{} + Peer peer.ID + Remote peer.ID + Timestamp int64 + Type string + type EventTracer interface + Trace func(evt *Event) + type HolePunchAttemptEvt struct + Attempt int + type MetricsTracer interface + DirectDialFinished func(success bool) + HolePunchFinished func(side string, attemptNum int, theirAddrs []ma.Multiaddr, ourAddr []ma.Multiaddr, ...) + func NewMetricsTracer(opts ...MetricsTracerOption) MetricsTracer + type MetricsTracerOption func(*metricsTracerSetting) + func WithRegisterer(reg prometheus.Registerer) MetricsTracerOption + type Option func(*Service) error + func WithAddrFilter(f AddrFilter) Option + func WithMetricsAndEventTracer(mt MetricsTracer, et EventTracer) Option + func WithMetricsTracer(mt MetricsTracer) Option + func WithTracer(et EventTracer) Option + type ProtocolErrorEvt struct + Error string + type Service struct + func NewService(h host.Host, ids identify.IDService, opts ...Option) (*Service, error) + func (s *Service) Close() error + func (s *Service) DirectConnect(p peer.ID) error + type StartHolePunchEvt struct + RTT time.Duration + RemoteAddrs []string