Versions in this module Expand all Collapse all v0 v0.7.1 Sep 14, 2022 v0.7.0 Jul 8, 2022 Changes in this version + const DefaultBlocklistTime + const HeaderNameTracingSpanContext + const ReachabilityStatusPrivate + const ReachabilityStatusPublic + const ReachabilityStatusUnknown + var ErrAlreadyConnected = errors.New("already connected") + var ErrDialLightNode = errors.New("target peer is a light node") + var ErrPeerNotFound = errors.New("peer not found") + var ErrUnexpected = errors.New("unexpected request while in light mode") + func Discover(ctx context.Context, addr ma.Multiaddr, f func(ma.Multiaddr) (bool, error)) (bool, error) + func NewBlockPeerError(duration time.Duration, err error) error + func NewConnectionBackoffError(err error, tryAfter time.Time) error + func NewDisconnectError(err error) error + func NewSwarmStreamName(protocol, version, stream string) string + func WithBlocklistStreams(dur time.Duration, spec ProtocolSpec) + func WithDisconnectStreams(spec ProtocolSpec) + type BlockPeerError struct + func (e *BlockPeerError) Duration() time.Duration + func (e *BlockPeerError) Error() string + func (e *BlockPeerError) Unwrap() error + type Blocklister interface + Blocklist func(overlay swarm.Address, duration time.Duration, reason string) error + type ConnectionBackoffError struct + func (e *ConnectionBackoffError) Error() string + func (e *ConnectionBackoffError) TryAfter() time.Time + func (e *ConnectionBackoffError) Unwrap() error + type DebugService interface + GetWelcomeMessage func() string + SetWelcomeMessage func(val string) error + type DisconnectError struct + func (e *DisconnectError) Error() string + func (e *DisconnectError) Unwrap() error + type Disconnecter interface + Disconnect func(overlay swarm.Address, reason string) error + type Halter interface + Halt func() + type HandlerFunc func(context.Context, Peer, Stream) error + type HandlerMiddleware func(HandlerFunc) HandlerFunc + type Headers map[string][]byte + type HeadlerFunc func(Headers, swarm.Address) Headers + type IncompatibleStreamError struct + func NewIncompatibleStreamError(err error) *IncompatibleStreamError + func (e *IncompatibleStreamError) Error() string + func (e *IncompatibleStreamError) Unwrap() error + type Notifier interface + Announce func(ctx context.Context, peer swarm.Address, fullnode bool) error + AnnounceTo func(ctx context.Context, addressee, peer swarm.Address, fullnode bool) error + Connected func(context.Context, Peer, bool) error + Disconnected func(Peer) + type Peer struct + Address swarm.Address + EthereumAddress []byte + FullNode bool + type Picker interface + Pick func(Peer) bool + type PickyNotifier interface + type Pinger interface + Ping func(ctx context.Context, addr ma.Multiaddr) (rtt time.Duration, err error) + type ProtocolSpec struct + ConnectIn func(context.Context, Peer) error + ConnectOut func(context.Context, Peer) error + DisconnectIn func(Peer) error + DisconnectOut func(Peer) error + Name string + StreamSpecs []StreamSpec + Version string + type ReachabilityStatus network.Reachability + func (rs ReachabilityStatus) String() string + type ReachabilityUpdater interface + UpdateReachability func(ReachabilityStatus) + type ReachableNotifier interface + Reachable func(swarm.Address, ReachabilityStatus) + type Reacher interface + Connected func(swarm.Address, ma.Multiaddr) + Disconnected func(swarm.Address) + type Service interface + AddProtocol func(ProtocolSpec) error + Addresses func() ([]ma.Multiaddr, error) + BlocklistedPeers func() ([]Peer, error) + Connect func(ctx context.Context, addr ma.Multiaddr) (address *hop.Address, err error) + Peers func() []Peer + SetPickyNotifier func(PickyNotifier) + type Stream interface + FullClose func() error + Headers func() Headers + Reset func() error + ResponseHeaders func() Headers + type StreamSpec struct + Handler HandlerFunc + Headler HeadlerFunc + Name string + type Streamer interface + NewStream func(ctx context.Context, address swarm.Address, h Headers, ...) (Stream, error) + type StreamerDisconnecter interface + type StreamerPinger interface