Documentation ¶
Index ¶
- Variables
- type Option
- func WithBaseAddr(a swarm.Address) Option
- func WithLightNode() Option
- func WithMiddlewares(middlewares ...p2p.HandlerMiddleware) Option
- func WithPeerProtocols(protocolsWithPeers map[string]p2p.ProtocolSpec) Option
- func WithPingErr(pingErr func(ma.Multiaddr) (time.Duration, error)) Option
- func WithProtocols(protocols ...p2p.ProtocolSpec) Option
- func WithStreamError(streamErr func(swarm.Address, string, string, string) error) Option
- type Record
- type Recorder
- func (r *Recorder) NewStream(ctx context.Context, addr swarm.Address, h p2p.Headers, ...) (p2p.Stream, error)
- func (r *Recorder) Ping(ctx context.Context, addr ma.Multiaddr) (rtt time.Duration, err error)
- func (r *Recorder) Records(addr swarm.Address, protocolName, protocolVersio, streamName string) ([]*Record, error)
- func (r *Recorder) SetProtocols(protocols ...p2p.ProtocolSpec)
- func (r *Recorder) WaitRecords(t *testing.T, addr swarm.Address, proto, version, stream string, ...) []*Record
- type RecorderDisconnecter
- func (r *RecorderDisconnecter) Blocklist(overlay swarm.Address, d time.Duration, _ string) error
- func (r *RecorderDisconnecter) Disconnect(overlay swarm.Address, _ string) error
- func (r *RecorderDisconnecter) IsBlocklisted(overlay swarm.Address) (bool, time.Duration)
- func (r *RecorderDisconnecter) IsDisconnected(overlay swarm.Address) bool
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithBaseAddr ¶ added in v0.5.3
func WithLightNode ¶ added in v0.6.0
func WithLightNode() Option
func WithMiddlewares ¶
func WithMiddlewares(middlewares ...p2p.HandlerMiddleware) Option
func WithPeerProtocols ¶ added in v0.6.0
func WithPeerProtocols(protocolsWithPeers map[string]p2p.ProtocolSpec) Option
func WithPingErr ¶ added in v1.1.0
func WithProtocols ¶
func WithProtocols(protocols ...p2p.ProtocolSpec) Option
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
func (*Recorder) SetProtocols ¶
func (r *Recorder) SetProtocols(protocols ...p2p.ProtocolSpec)
func (*Recorder) WaitRecords ¶
func (r *Recorder) WaitRecords(t *testing.T, addr swarm.Address, proto, version, stream string, msgs, timeoutSec int) []*Record
WaitRecords waits for some time for records to come into the recorder. If msgs is 0, the timeoutSec period is waited to verify that _no_ messages arrive during this time period.
type RecorderDisconnecter ¶ added in v0.4.0
type RecorderDisconnecter struct { *Recorder // contains filtered or unexported fields }
func NewRecorderDisconnecter ¶ added in v0.4.0
func NewRecorderDisconnecter(r *Recorder) *RecorderDisconnecter
func (*RecorderDisconnecter) Disconnect ¶ added in v0.4.0
func (r *RecorderDisconnecter) Disconnect(overlay swarm.Address, _ string) error
func (*RecorderDisconnecter) IsBlocklisted ¶ added in v0.4.0
func (*RecorderDisconnecter) IsDisconnected ¶ added in v0.4.0
func (r *RecorderDisconnecter) IsDisconnected(overlay swarm.Address) bool
Click to show internal directories.
Click to hide internal directories.