Documentation ¶
Index ¶
- Variables
- type Option
- func WithBaseAddr(a penguin.Address) Option
- func WithLightNode() Option
- func WithMiddlewares(middlewares ...p2p.HandlerMiddleware) Option
- func WithPeerProtocols(protocolsWithPeers map[string]p2p.ProtocolSpec) Option
- func WithProtocols(protocols ...p2p.ProtocolSpec) Option
- func WithStreamError(streamErr func(penguin.Address, string, string, string) error) Option
- type Record
- type Recorder
- func (r *Recorder) NewStream(ctx context.Context, addr penguin.Address, h p2p.Headers, ...) (p2p.Stream, error)
- func (r *Recorder) Records(addr penguin.Address, protocolName, protocolVersio, streamName string) ([]*Record, error)
- func (r *Recorder) SetProtocols(protocols ...p2p.ProtocolSpec)
- func (r *Recorder) WaitRecords(t *testing.T, addr penguin.Address, proto, version, stream string, ...) []*Record
- type RecorderDisconnecter
- func (r *RecorderDisconnecter) Blocklist(overlay penguin.Address, d time.Duration) error
- func (r *RecorderDisconnecter) Disconnect(overlay penguin.Address) error
- func (r *RecorderDisconnecter) IsBlocklisted(overlay penguin.Address) (bool, time.Duration)
- func (r *RecorderDisconnecter) IsDisconnected(overlay penguin.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 ¶
func WithLightNode ¶
func WithLightNode() Option
func WithMiddlewares ¶
func WithMiddlewares(middlewares ...p2p.HandlerMiddleware) Option
func WithPeerProtocols ¶
func WithPeerProtocols(protocolsWithPeers map[string]p2p.ProtocolSpec) Option
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 penguin.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 ¶
type RecorderDisconnecter struct { *Recorder // contains filtered or unexported fields }
func NewRecorderDisconnecter ¶
func NewRecorderDisconnecter(r *Recorder) *RecorderDisconnecter
func (*RecorderDisconnecter) Disconnect ¶
func (r *RecorderDisconnecter) Disconnect(overlay penguin.Address) error
func (*RecorderDisconnecter) IsBlocklisted ¶
func (*RecorderDisconnecter) IsDisconnected ¶
func (r *RecorderDisconnecter) IsDisconnected(overlay penguin.Address) bool
Click to show internal directories.
Click to hide internal directories.