mock

package
v1.2.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNetworkShardingCollectorMock added in v1.2.0

func NewNetworkShardingCollectorMock() *networkShardingCollectorMock

NewNetworkShardingCollectorMock -

func NewStreamMock

func NewStreamMock() *streamMock

NewStreamMock -

Types

type ChannelLoadBalancerStub

type ChannelLoadBalancerStub struct {
	AddChannelCalled                    func(pipe string) error
	RemoveChannelCalled                 func(pipe string) error
	GetChannelOrDefaultCalled           func(pipe string) chan *p2p.SendableData
	CollectOneElementFromChannelsCalled func() *p2p.SendableData
	CloseCalled                         func() error
}

ChannelLoadBalancerStub -

func (*ChannelLoadBalancerStub) AddChannel

func (clbs *ChannelLoadBalancerStub) AddChannel(pipe string) error

AddChannel -

func (*ChannelLoadBalancerStub) Close added in v1.0.115

func (clbs *ChannelLoadBalancerStub) Close() error

Close -

func (*ChannelLoadBalancerStub) CollectOneElementFromChannels

func (clbs *ChannelLoadBalancerStub) CollectOneElementFromChannels() *p2p.SendableData

CollectOneElementFromChannels -

func (*ChannelLoadBalancerStub) GetChannelOrDefault

func (clbs *ChannelLoadBalancerStub) GetChannelOrDefault(pipe string) chan *p2p.SendableData

GetChannelOrDefault -

func (*ChannelLoadBalancerStub) IsInterfaceNil

func (clbs *ChannelLoadBalancerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ChannelLoadBalancerStub) RemoveChannel

func (clbs *ChannelLoadBalancerStub) RemoveChannel(pipe string) error

RemoveChannel -

type ConnManagerNotifieeStub

type ConnManagerNotifieeStub struct {
	UpsertTagCalled     func(p peer.ID, tag string, upsert func(int) int)
	ProtectCalled       func(id peer.ID, tag string)
	UnprotectCalled     func(id peer.ID, tag string) (protected bool)
	CloseCalled         func() error
	TagPeerCalled       func(p peer.ID, tag string, val int)
	UntagPeerCalled     func(p peer.ID, tag string)
	GetTagInfoCalled    func(p peer.ID) *connmgr.TagInfo
	TrimOpenConnsCalled func(ctx context.Context)
	ListenCalled        func(netw network.Network, ma multiaddr.Multiaddr)
	ListenCloseCalled   func(netw network.Network, ma multiaddr.Multiaddr)
	ConnectedCalled     func(netw network.Network, conn network.Conn)
	DisconnectedCalled  func(netw network.Network, conn network.Conn)
	OpenedStreamCalled  func(netw network.Network, stream network.Stream)
	ClosedStreamCalled  func(netw network.Network, stream network.Stream)
}

ConnManagerNotifieeStub -

func (*ConnManagerNotifieeStub) Close

func (cmns *ConnManagerNotifieeStub) Close() error

Close -

func (*ConnManagerNotifieeStub) ClosedStream

func (cmns *ConnManagerNotifieeStub) ClosedStream(netw network.Network, stream network.Stream)

ClosedStream -

func (*ConnManagerNotifieeStub) Connected

func (cmns *ConnManagerNotifieeStub) Connected(netw network.Network, conn network.Conn)

Connected -

func (*ConnManagerNotifieeStub) Disconnected

func (cmns *ConnManagerNotifieeStub) Disconnected(netw network.Network, conn network.Conn)

Disconnected -

func (*ConnManagerNotifieeStub) GetTagInfo

func (cmns *ConnManagerNotifieeStub) GetTagInfo(p peer.ID) *connmgr.TagInfo

GetTagInfo -

func (*ConnManagerNotifieeStub) Listen

func (cmns *ConnManagerNotifieeStub) Listen(netw network.Network, ma multiaddr.Multiaddr)

Listen -

func (*ConnManagerNotifieeStub) ListenClose

func (cmns *ConnManagerNotifieeStub) ListenClose(netw network.Network, ma multiaddr.Multiaddr)

ListenClose -

func (*ConnManagerNotifieeStub) Notifee

func (cmns *ConnManagerNotifieeStub) Notifee() network.Notifiee

Notifee -

func (*ConnManagerNotifieeStub) OpenedStream

func (cmns *ConnManagerNotifieeStub) OpenedStream(netw network.Network, stream network.Stream)

OpenedStream -

func (*ConnManagerNotifieeStub) Protect

func (cmns *ConnManagerNotifieeStub) Protect(id peer.ID, tag string)

Protect -

func (*ConnManagerNotifieeStub) TagPeer

func (cmns *ConnManagerNotifieeStub) TagPeer(p peer.ID, tag string, val int)

TagPeer -

func (*ConnManagerNotifieeStub) TrimOpenConns

func (cmns *ConnManagerNotifieeStub) TrimOpenConns(ctx context.Context)

TrimOpenConns -

func (*ConnManagerNotifieeStub) Unprotect

func (cmns *ConnManagerNotifieeStub) Unprotect(id peer.ID, tag string) (protected bool)

Unprotect -

func (*ConnManagerNotifieeStub) UntagPeer

func (cmns *ConnManagerNotifieeStub) UntagPeer(p peer.ID, tag string)

UntagPeer -

func (*ConnManagerNotifieeStub) UpsertTag

func (cmns *ConnManagerNotifieeStub) UpsertTag(p peer.ID, tag string, upsert func(int) int)

UpsertTag -

type ConnStub

type ConnStub struct {
	IDCalled              func() string
	CloseCalled           func() error
	LocalPeerCalled       func() peer.ID
	LocalPrivateKeyCalled func() libp2pCrypto.PrivKey
	RemotePeerCalled      func() peer.ID
	RemotePublicKeyCalled func() libp2pCrypto.PubKey
	LocalMultiaddrCalled  func() multiaddr.Multiaddr
	RemoteMultiaddrCalled func() multiaddr.Multiaddr
	NewStreamCalled       func(ctx context.Context) (network.Stream, error)
	GetStreamsCalled      func() []network.Stream
	StatCalled            func() network.Stat
}

ConnStub -

func (*ConnStub) Close

func (cs *ConnStub) Close() error

Close -

func (*ConnStub) GetStreams

func (cs *ConnStub) GetStreams() []network.Stream

GetStreams -

func (*ConnStub) ID added in v1.1.1

func (cs *ConnStub) ID() string

ID -

func (*ConnStub) LocalMultiaddr

func (cs *ConnStub) LocalMultiaddr() multiaddr.Multiaddr

LocalMultiaddr -

func (*ConnStub) LocalPeer

func (cs *ConnStub) LocalPeer() peer.ID

LocalPeer -

func (*ConnStub) LocalPrivateKey

func (cs *ConnStub) LocalPrivateKey() libp2pCrypto.PrivKey

LocalPrivateKey -

func (*ConnStub) NewStream

func (cs *ConnStub) NewStream(ctx context.Context) (network.Stream, error)

NewStream -

func (*ConnStub) RemoteMultiaddr

func (cs *ConnStub) RemoteMultiaddr() multiaddr.Multiaddr

RemoteMultiaddr -

func (*ConnStub) RemotePeer

func (cs *ConnStub) RemotePeer() peer.ID

RemotePeer -

func (*ConnStub) RemotePublicKey

func (cs *ConnStub) RemotePublicKey() libp2pCrypto.PubKey

RemotePublicKey -

func (*ConnStub) Stat

func (cs *ConnStub) Stat() network.Stat

Stat -

type ConnectableHostStub

type ConnectableHostStub struct {
	EventBusCalled              func() event.Bus
	IDCalled                    func() peer.ID
	PeerstoreCalled             func() peerstore.Peerstore
	AddrsCalled                 func() []multiaddr.Multiaddr
	NetworkCalled               func() network.Network
	MuxCalled                   func() protocol.Switch
	ConnectCalled               func(ctx context.Context, pi peer.AddrInfo) error
	SetStreamHandlerCalled      func(pid protocol.ID, handler network.StreamHandler)
	SetStreamHandlerMatchCalled func(protocol.ID, func(string) bool, network.StreamHandler)
	RemoveStreamHandlerCalled   func(pid protocol.ID)
	NewStreamCalled             func(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error)
	CloseCalled                 func() error
	ConnManagerCalled           func() connmgr.ConnManager
	ConnectToPeerCalled         func(ctx context.Context, address string) error
	AddressToPeerInfoCalled     func(address string) (*peer.AddrInfo, error)
}

ConnectableHostStub -

func (*ConnectableHostStub) AddressToPeerInfo added in v1.2.0

func (hs *ConnectableHostStub) AddressToPeerInfo(address string) (*peer.AddrInfo, error)

AddressToPeerInfo -

func (*ConnectableHostStub) Addrs

func (hs *ConnectableHostStub) Addrs() []multiaddr.Multiaddr

Addrs -

func (*ConnectableHostStub) Close

func (hs *ConnectableHostStub) Close() error

Close -

func (*ConnectableHostStub) ConnManager

func (hs *ConnectableHostStub) ConnManager() connmgr.ConnManager

ConnManager -

func (*ConnectableHostStub) Connect

func (hs *ConnectableHostStub) Connect(ctx context.Context, pi peer.AddrInfo) error

Connect -

func (*ConnectableHostStub) ConnectToPeer

func (hs *ConnectableHostStub) ConnectToPeer(ctx context.Context, address string) error

ConnectToPeer -

func (*ConnectableHostStub) EventBus

func (hs *ConnectableHostStub) EventBus() event.Bus

EventBus -

func (*ConnectableHostStub) ID

func (hs *ConnectableHostStub) ID() peer.ID

ID -

func (*ConnectableHostStub) IsInterfaceNil

func (hs *ConnectableHostStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ConnectableHostStub) Mux

Mux -

func (*ConnectableHostStub) Network

func (hs *ConnectableHostStub) Network() network.Network

Network -

func (*ConnectableHostStub) NewStream

func (hs *ConnectableHostStub) NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error)

NewStream -

func (*ConnectableHostStub) Peerstore

func (hs *ConnectableHostStub) Peerstore() peerstore.Peerstore

Peerstore -

func (*ConnectableHostStub) RemoveStreamHandler

func (hs *ConnectableHostStub) RemoveStreamHandler(pid protocol.ID)

RemoveStreamHandler -

func (*ConnectableHostStub) SetStreamHandler

func (hs *ConnectableHostStub) SetStreamHandler(pid protocol.ID, handler network.StreamHandler)

SetStreamHandler -

func (*ConnectableHostStub) SetStreamHandlerMatch

func (hs *ConnectableHostStub) SetStreamHandlerMatch(pid protocol.ID, handler func(string) bool, streamHandler network.StreamHandler)

SetStreamHandlerMatch -

type ConnectionMonitorStub

type ConnectionMonitorStub struct {
	ListenCalled                        func(netw network.Network, ma multiaddr.Multiaddr)
	ListenCloseCalled                   func(netw network.Network, ma multiaddr.Multiaddr)
	ConnectedCalled                     func(netw network.Network, conn network.Conn)
	DisconnectedCalled                  func(netw network.Network, conn network.Conn)
	OpenedStreamCalled                  func(netw network.Network, stream network.Stream)
	ClosedStreamCalled                  func(netw network.Network, stream network.Stream)
	IsConnectedToTheNetworkCalled       func(netw network.Network) bool
	SetThresholdMinConnectedPeersCalled func(thresholdMinConnectedPeers int, netw network.Network)
	ThresholdMinConnectedPeersCalled    func() int
}

ConnectionMonitorStub -

func (*ConnectionMonitorStub) Close added in v1.2.0

func (cms *ConnectionMonitorStub) Close() error

Close -

func (*ConnectionMonitorStub) ClosedStream

func (cms *ConnectionMonitorStub) ClosedStream(netw network.Network, stream network.Stream)

ClosedStream -

func (*ConnectionMonitorStub) Connected

func (cms *ConnectionMonitorStub) Connected(netw network.Network, conn network.Conn)

Connected -

func (*ConnectionMonitorStub) Disconnected

func (cms *ConnectionMonitorStub) Disconnected(netw network.Network, conn network.Conn)

Disconnected -

func (*ConnectionMonitorStub) IsConnectedToTheNetwork

func (cms *ConnectionMonitorStub) IsConnectedToTheNetwork(netw network.Network) bool

IsConnectedToTheNetwork -

func (*ConnectionMonitorStub) IsInterfaceNil

func (cms *ConnectionMonitorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ConnectionMonitorStub) Listen

func (cms *ConnectionMonitorStub) Listen(netw network.Network, ma multiaddr.Multiaddr)

Listen -

func (*ConnectionMonitorStub) ListenClose

func (cms *ConnectionMonitorStub) ListenClose(netw network.Network, ma multiaddr.Multiaddr)

ListenClose -

func (*ConnectionMonitorStub) OpenedStream

func (cms *ConnectionMonitorStub) OpenedStream(netw network.Network, stream network.Stream)

OpenedStream -

func (*ConnectionMonitorStub) SetThresholdMinConnectedPeers

func (cms *ConnectionMonitorStub) SetThresholdMinConnectedPeers(thresholdMinConnectedPeers int, netw network.Network)

SetThresholdMinConnectedPeers -

func (*ConnectionMonitorStub) ThresholdMinConnectedPeers

func (cms *ConnectionMonitorStub) ThresholdMinConnectedPeers() int

ThresholdMinConnectedPeers -

type ContextProviderMock

type ContextProviderMock struct {
}

ContextProviderMock -

func (*ContextProviderMock) Context

func (*ContextProviderMock) Context() context.Context

Context -

func (*ContextProviderMock) IsInterfaceNil

func (c *ContextProviderMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type EventBusStub added in v1.0.114

type EventBusStub struct {
	SubscribeCalled        func(eventType interface{}, opts ...event.SubscriptionOpt) (event.Subscription, error)
	EmitterCalled          func(eventType interface{}, opts ...event.EmitterOpt) (event.Emitter, error)
	GetAllEventTypesCalled func() []reflect.Type
}

EventBusStub -

func (*EventBusStub) Emitter added in v1.0.114

func (ebs *EventBusStub) Emitter(eventType interface{}, opts ...event.EmitterOpt) (event.Emitter, error)

Emitter -

func (*EventBusStub) GetAllEventTypes added in v1.0.132

func (ebs *EventBusStub) GetAllEventTypes() []reflect.Type

GetAllEventTypes -

func (*EventBusStub) Subscribe added in v1.0.114

func (ebs *EventBusStub) Subscribe(eventType interface{}, opts ...event.SubscriptionOpt) (event.Subscription, error)

Subscribe -

type EventSubscriptionStub added in v1.0.114

type EventSubscriptionStub struct {
	CloseCalled func() error
	OutCalled   func() <-chan interface{}
}

EventSubscriptionStub -

func (*EventSubscriptionStub) Close added in v1.0.114

func (ess *EventSubscriptionStub) Close() error

Close -

func (*EventSubscriptionStub) Out added in v1.0.114

func (ess *EventSubscriptionStub) Out() <-chan interface{}

Out -

type KadDhtHandlerStub added in v1.2.0

type KadDhtHandlerStub struct {
	BootstrapCalled func(ctx context.Context) error
}

KadDhtHandlerStub -

func (*KadDhtHandlerStub) Bootstrap added in v1.2.0

func (kdhs *KadDhtHandlerStub) Bootstrap(ctx context.Context) error

Bootstrap -

type KadSharderStub added in v1.2.0

type KadSharderStub struct {
	ComputeEvictListCalled     func(pidList []peer.ID) []peer.ID
	HasCalled                  func(pid peer.ID, list []peer.ID) bool
	SetPeerShardResolverCalled func(psp p2p.PeerShardResolver) error
	SetSeedersCalled           func(addresses []string)
	IsSeederCalled             func(pid core.PeerID) bool
}

KadSharderStub -

func (*KadSharderStub) ComputeEvictionList added in v1.2.0

func (kss *KadSharderStub) ComputeEvictionList(pidList []peer.ID) []peer.ID

ComputeEvictionList -

func (*KadSharderStub) Has added in v1.2.0

func (kss *KadSharderStub) Has(pid peer.ID, list []peer.ID) bool

Has -

func (*KadSharderStub) IsInterfaceNil added in v1.2.0

func (kss *KadSharderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*KadSharderStub) IsSeeder added in v1.2.0

func (kss *KadSharderStub) IsSeeder(pid core.PeerID) bool

IsSeeder -

func (*KadSharderStub) SetPeerShardResolver added in v1.2.0

func (kss *KadSharderStub) SetPeerShardResolver(psp p2p.PeerShardResolver) error

SetPeerShardResolver -

func (*KadSharderStub) SetSeeders added in v1.2.0

func (kss *KadSharderStub) SetSeeders(addresses []string)

SetSeeders -

type MarshalizerStub

type MarshalizerStub struct {
	MarshalCalled   func(obj interface{}) ([]byte, error)
	UnmarshalCalled func(obj interface{}, buff []byte) error
}

MarshalizerStub -

func (*MarshalizerStub) IsInterfaceNil

func (ms *MarshalizerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*MarshalizerStub) Marshal

func (ms *MarshalizerStub) Marshal(obj interface{}) ([]byte, error)

Marshal -

func (*MarshalizerStub) Unmarshal

func (ms *MarshalizerStub) Unmarshal(obj interface{}, buff []byte) error

Unmarshal -

type MessageProcessorStub

type MessageProcessorStub struct {
	ProcessMessageCalled func(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
}

MessageProcessorStub -

func (*MessageProcessorStub) IsInterfaceNil

func (mps *MessageProcessorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MessageProcessorStub) ProcessReceivedMessage

func (mps *MessageProcessorStub) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error

ProcessReceivedMessage -

type MultiaddrStub added in v1.1.28

type MultiaddrStub struct {
	MarshalJSONCalled      func() ([]byte, error)
	UnmarshalJSONCalled    func(bytes []byte) error
	MarshalTextCalled      func() (text []byte, err error)
	UnmarshalTextCalled    func(text []byte) error
	MarshalBinaryCalled    func() (data []byte, err error)
	UnmarshalBinaryCalled  func(data []byte) error
	EqualCalled            func(multiaddr multiaddr.Multiaddr) bool
	BytesCalled            func() []byte
	StringCalled           func() string
	ProtocolsCalled        func() []multiaddr.Protocol
	EncapsulateCalled      func(multiaddr multiaddr.Multiaddr) multiaddr.Multiaddr
	DecapsulateCalled      func(multiaddr multiaddr.Multiaddr) multiaddr.Multiaddr
	ValueForProtocolCalled func(code int) (string, error)
}

MultiaddrStub -

func (*MultiaddrStub) Bytes added in v1.1.28

func (mas *MultiaddrStub) Bytes() []byte

Bytes -

func (*MultiaddrStub) Decapsulate added in v1.1.28

func (mas *MultiaddrStub) Decapsulate(multiaddr multiaddr.Multiaddr) multiaddr.Multiaddr

Decapsulate -

func (*MultiaddrStub) Encapsulate added in v1.1.28

func (mas *MultiaddrStub) Encapsulate(multiaddr multiaddr.Multiaddr) multiaddr.Multiaddr

Encapsulate -

func (*MultiaddrStub) Equal added in v1.1.28

func (mas *MultiaddrStub) Equal(multiaddr multiaddr.Multiaddr) bool

Equal -

func (*MultiaddrStub) MarshalBinary added in v1.1.28

func (mas *MultiaddrStub) MarshalBinary() (data []byte, err error)

MarshalBinary -

func (*MultiaddrStub) MarshalJSON added in v1.1.28

func (mas *MultiaddrStub) MarshalJSON() ([]byte, error)

MarshalJSON -

func (*MultiaddrStub) MarshalText added in v1.1.28

func (mas *MultiaddrStub) MarshalText() (text []byte, err error)

MarshalText -

func (*MultiaddrStub) Protocols added in v1.1.28

func (mas *MultiaddrStub) Protocols() []multiaddr.Protocol

Protocols -

func (*MultiaddrStub) String added in v1.1.28

func (mas *MultiaddrStub) String() string

String -

func (*MultiaddrStub) UnmarshalBinary added in v1.1.28

func (mas *MultiaddrStub) UnmarshalBinary(data []byte) error

UnmarshalBinary -

func (*MultiaddrStub) UnmarshalJSON added in v1.1.28

func (mas *MultiaddrStub) UnmarshalJSON(bytes []byte) error

UnmarshalJSON -

func (*MultiaddrStub) UnmarshalText added in v1.1.28

func (mas *MultiaddrStub) UnmarshalText(text []byte) error

UnmarshalText -

func (*MultiaddrStub) ValueForProtocol added in v1.1.28

func (mas *MultiaddrStub) ValueForProtocol(code int) (string, error)

ValueForProtocol -

type NetworkStub

type NetworkStub struct {
	ConnsToPeerCalled   func(p peer.ID) []network.Conn
	ConnsCalled         func() []network.Conn
	ConnectednessCalled func(peer.ID) network.Connectedness
	NotifyCalled        func(network.Notifiee)
	StopNotifyCalled    func(network.Notifiee)
	PeersCall           func() []peer.ID
	ClosePeerCall       func(peer.ID) error
}

NetworkStub -

func (*NetworkStub) Close

func (ns *NetworkStub) Close() error

Close -

func (*NetworkStub) ClosePeer

func (ns *NetworkStub) ClosePeer(pid peer.ID) error

ClosePeer -

func (*NetworkStub) Connectedness

func (ns *NetworkStub) Connectedness(pid peer.ID) network.Connectedness

Connectedness -

func (*NetworkStub) Conns

func (ns *NetworkStub) Conns() []network.Conn

Conns -

func (*NetworkStub) ConnsToPeer

func (ns *NetworkStub) ConnsToPeer(p peer.ID) []network.Conn

ConnsToPeer -

func (*NetworkStub) DialPeer

func (ns *NetworkStub) DialPeer(_ context.Context, _ peer.ID) (network.Conn, error)

DialPeer -

func (*NetworkStub) InterfaceListenAddresses

func (ns *NetworkStub) InterfaceListenAddresses() ([]multiaddr.Multiaddr, error)

InterfaceListenAddresses -

func (*NetworkStub) Listen

func (ns *NetworkStub) Listen(...multiaddr.Multiaddr) error

Listen -

func (*NetworkStub) ListenAddresses

func (ns *NetworkStub) ListenAddresses() []multiaddr.Multiaddr

ListenAddresses -

func (*NetworkStub) LocalPeer

func (ns *NetworkStub) LocalPeer() peer.ID

LocalPeer -

func (*NetworkStub) NewStream

func (ns *NetworkStub) NewStream(context.Context, peer.ID) (network.Stream, error)

NewStream -

func (*NetworkStub) Notify

func (ns *NetworkStub) Notify(notifee network.Notifiee)

Notify -

func (*NetworkStub) Peers

func (ns *NetworkStub) Peers() []peer.ID

Peers -

func (*NetworkStub) Peerstore

func (ns *NetworkStub) Peerstore() peerstore.Peerstore

Peerstore -

func (*NetworkStub) Process

func (ns *NetworkStub) Process() goprocess.Process

Process -

func (*NetworkStub) SetConnHandler

func (ns *NetworkStub) SetConnHandler(network.ConnHandler)

SetConnHandler -

func (*NetworkStub) SetStreamHandler

func (ns *NetworkStub) SetStreamHandler(network.StreamHandler)

SetStreamHandler -

func (*NetworkStub) StopNotify

func (ns *NetworkStub) StopNotify(notifee network.Notifiee)

StopNotify -

type P2PMessageMock

type P2PMessageMock struct {
	FromField      []byte
	DataField      []byte
	SeqNoField     []byte
	TopicField     string
	SignatureField []byte
	KeyField       []byte
	PeerField      core.PeerID
	PayloadField   []byte
	TimestampField int64
}

P2PMessageMock -

func (*P2PMessageMock) Data

func (msg *P2PMessageMock) Data() []byte

Data -

func (*P2PMessageMock) From

func (msg *P2PMessageMock) From() []byte

From -

func (*P2PMessageMock) IsInterfaceNil

func (msg *P2PMessageMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*P2PMessageMock) Key

func (msg *P2PMessageMock) Key() []byte

Key -

func (*P2PMessageMock) Payload added in v1.0.133

func (msg *P2PMessageMock) Payload() []byte

Payload -

func (*P2PMessageMock) Peer

func (msg *P2PMessageMock) Peer() core.PeerID

Peer -

func (*P2PMessageMock) SeqNo

func (msg *P2PMessageMock) SeqNo() []byte

SeqNo -

func (*P2PMessageMock) Signature

func (msg *P2PMessageMock) Signature() []byte

Signature -

func (*P2PMessageMock) Timestamp added in v1.0.133

func (msg *P2PMessageMock) Timestamp() int64

Timestamp -

func (*P2PMessageMock) Topic added in v1.1.46

func (msg *P2PMessageMock) Topic() string

Topic -

type PeerDenialEvaluatorStub added in v1.0.133

type PeerDenialEvaluatorStub struct {
	UpsertPeerIDCalled func(pid core.PeerID, duration time.Duration) error
	IsDeniedCalled     func(pid core.PeerID) bool
}

PeerDenialEvaluatorStub -

func (*PeerDenialEvaluatorStub) IsDenied added in v1.0.133

func (pdes *PeerDenialEvaluatorStub) IsDenied(pid core.PeerID) bool

IsDenied -

func (*PeerDenialEvaluatorStub) IsInterfaceNil added in v1.0.133

func (pdes *PeerDenialEvaluatorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerDenialEvaluatorStub) UpsertPeerID added in v1.0.133

func (pdes *PeerDenialEvaluatorStub) UpsertPeerID(pid core.PeerID, duration time.Duration) error

UpsertPeerID -

type PeerDiscovererStub

type PeerDiscovererStub struct {
	BootstrapCalled func() error
	CloseCalled     func() error
}

PeerDiscovererStub -

func (*PeerDiscovererStub) Bootstrap

func (pds *PeerDiscovererStub) Bootstrap() error

Bootstrap -

func (*PeerDiscovererStub) IsInterfaceNil

func (pds *PeerDiscovererStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PeerDiscovererStub) Name

func (pds *PeerDiscovererStub) Name() string

Name -

type PeerShardResolverStub

type PeerShardResolverStub struct {
	GetPeerInfoCalled func(pid core.PeerID) core.P2PPeerInfo
}

PeerShardResolverStub -

func (*PeerShardResolverStub) GetPeerInfo

func (psrs *PeerShardResolverStub) GetPeerInfo(pid core.PeerID) core.P2PPeerInfo

GetPeerInfo -

func (*PeerShardResolverStub) IsInterfaceNil

func (psrs *PeerShardResolverStub) IsInterfaceNil() bool

IsInterfaceNil -

type PeerstoreStub added in v1.1.28

type PeerstoreStub struct {
	CloseCalled                  func() error
	AddAddrCalled                func(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration)
	AddAddrsCalled               func(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration)
	SetAddrCalled                func(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration)
	SetAddrsCalled               func(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration)
	UpdateAddrsCalled            func(p peer.ID, oldTTL time.Duration, newTTL time.Duration)
	AddrsCalled                  func(p peer.ID) []multiaddr.Multiaddr
	AddrStreamCalled             func(ctx context.Context, id peer.ID) <-chan multiaddr.Multiaddr
	ClearAddrsCalled             func(p peer.ID)
	PeersWithAddrsCalled         func() peer.IDSlice
	PubKeyCalled                 func(id peer.ID) libp2pCrypto.PubKey
	AddPubKeyCalled              func(id peer.ID, key libp2pCrypto.PubKey) error
	PrivKeyCalled                func(id peer.ID) libp2pCrypto.PrivKey
	AddPrivKeyCalled             func(id peer.ID, key libp2pCrypto.PrivKey) error
	PeersWithKeysCalled          func() peer.IDSlice
	GetCalled                    func(p peer.ID, key string) (interface{}, error)
	PutCalled                    func(p peer.ID, key string, val interface{}) error
	RecordLatencyCalled          func(id peer.ID, duration time.Duration)
	LatencyEWMACalled            func(id peer.ID) time.Duration
	GetProtocolsCalled           func(id peer.ID) ([]string, error)
	AddProtocolsCalled           func(id peer.ID, s ...string) error
	SetProtocolsCalled           func(id peer.ID, s ...string) error
	RemoveProtocolsCalled        func(id peer.ID, s ...string) error
	SupportsProtocolsCalled      func(id peer.ID, s ...string) ([]string, error)
	FirstSupportedProtocolCalled func(id peer.ID, s ...string) (string, error)
	PeerInfoCalled               func(id peer.ID) peer.AddrInfo
	PeersCalled                  func() peer.IDSlice
}

PeerstoreStub -

func (*PeerstoreStub) AddAddr added in v1.1.28

func (ps *PeerstoreStub) AddAddr(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration)

AddAddr -

func (*PeerstoreStub) AddAddrs added in v1.1.28

func (ps *PeerstoreStub) AddAddrs(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration)

AddAddrs -

func (*PeerstoreStub) AddPrivKey added in v1.1.28

func (ps *PeerstoreStub) AddPrivKey(id peer.ID, key libp2pCrypto.PrivKey) error

AddPrivKey -

func (*PeerstoreStub) AddProtocols added in v1.1.28

func (ps *PeerstoreStub) AddProtocols(id peer.ID, s ...string) error

AddProtocols -

func (*PeerstoreStub) AddPubKey added in v1.1.28

func (ps *PeerstoreStub) AddPubKey(id peer.ID, key libp2pCrypto.PubKey) error

AddPubKey -

func (*PeerstoreStub) AddrStream added in v1.1.28

func (ps *PeerstoreStub) AddrStream(ctx context.Context, id peer.ID) <-chan multiaddr.Multiaddr

AddrStream -

func (*PeerstoreStub) Addrs added in v1.1.28

func (ps *PeerstoreStub) Addrs(p peer.ID) []multiaddr.Multiaddr

Addrs -

func (*PeerstoreStub) ClearAddrs added in v1.1.28

func (ps *PeerstoreStub) ClearAddrs(p peer.ID)

ClearAddrs -

func (*PeerstoreStub) Close added in v1.1.28

func (ps *PeerstoreStub) Close() error

Close -

func (*PeerstoreStub) FirstSupportedProtocol added in v1.1.28

func (ps *PeerstoreStub) FirstSupportedProtocol(id peer.ID, s ...string) (string, error)

FirstSupportedProtocol -

func (*PeerstoreStub) Get added in v1.1.28

func (ps *PeerstoreStub) Get(p peer.ID, key string) (interface{}, error)

Get -

func (*PeerstoreStub) GetProtocols added in v1.1.28

func (ps *PeerstoreStub) GetProtocols(id peer.ID) ([]string, error)

GetProtocols -

func (*PeerstoreStub) LatencyEWMA added in v1.1.28

func (ps *PeerstoreStub) LatencyEWMA(id peer.ID) time.Duration

LatencyEWMA -

func (*PeerstoreStub) PeerInfo added in v1.1.28

func (ps *PeerstoreStub) PeerInfo(id peer.ID) peer.AddrInfo

PeerInfo -

func (*PeerstoreStub) Peers added in v1.1.28

func (ps *PeerstoreStub) Peers() peer.IDSlice

Peers -

func (*PeerstoreStub) PeersWithAddrs added in v1.1.28

func (ps *PeerstoreStub) PeersWithAddrs() peer.IDSlice

PeersWithAddrs -

func (*PeerstoreStub) PeersWithKeys added in v1.1.28

func (ps *PeerstoreStub) PeersWithKeys() peer.IDSlice

PeersWithKeys -

func (*PeerstoreStub) PrivKey added in v1.1.28

func (ps *PeerstoreStub) PrivKey(id peer.ID) libp2pCrypto.PrivKey

PrivKey -

func (*PeerstoreStub) PubKey added in v1.1.28

func (ps *PeerstoreStub) PubKey(id peer.ID) libp2pCrypto.PubKey

PubKey -

func (*PeerstoreStub) Put added in v1.1.28

func (ps *PeerstoreStub) Put(p peer.ID, key string, val interface{}) error

Put -

func (*PeerstoreStub) RecordLatency added in v1.1.28

func (ps *PeerstoreStub) RecordLatency(id peer.ID, duration time.Duration)

RecordLatency -

func (*PeerstoreStub) RemoveProtocols added in v1.1.28

func (ps *PeerstoreStub) RemoveProtocols(id peer.ID, s ...string) error

RemoveProtocols -

func (*PeerstoreStub) SetAddr added in v1.1.28

func (ps *PeerstoreStub) SetAddr(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration)

SetAddr -

func (*PeerstoreStub) SetAddrs added in v1.1.28

func (ps *PeerstoreStub) SetAddrs(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration)

SetAddrs -

func (*PeerstoreStub) SetProtocols added in v1.1.28

func (ps *PeerstoreStub) SetProtocols(id peer.ID, s ...string) error

SetProtocols -

func (*PeerstoreStub) SupportsProtocols added in v1.1.28

func (ps *PeerstoreStub) SupportsProtocols(id peer.ID, s ...string) ([]string, error)

SupportsProtocols -

func (*PeerstoreStub) UpdateAddrs added in v1.1.28

func (ps *PeerstoreStub) UpdateAddrs(p peer.ID, oldTTL time.Duration, newTTL time.Duration)

UpdateAddrs -

type ReconnecterStub

type ReconnecterStub struct {
	ReconnectToNetworkCalled func(ctx context.Context)
	PauseCall                func()
	ResumeCall               func()
}

ReconnecterStub -

func (*ReconnecterStub) IsInterfaceNil

func (rs *ReconnecterStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ReconnecterStub) ReconnectToNetwork

func (rs *ReconnecterStub) ReconnectToNetwork(ctx context.Context)

ReconnectToNetwork -

type SharderStub

type SharderStub struct {
	SetPeerShardResolverCalled func(psp p2p.PeerShardResolver) error
	SetSeedersCalled           func(addresses []string)
	IsSeederCalled             func(pid core.PeerID) bool
}

SharderStub -

func (*SharderStub) IsInterfaceNil

func (ss *SharderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*SharderStub) IsSeeder added in v1.2.0

func (ss *SharderStub) IsSeeder(pid core.PeerID) bool

IsSeeder -

func (*SharderStub) SetPeerShardResolver

func (ss *SharderStub) SetPeerShardResolver(psp p2p.PeerShardResolver) error

SetPeerShardResolver -

func (*SharderStub) SetSeeders added in v1.2.0

func (ss *SharderStub) SetSeeders(addresses []string)

SetSeeders -

type SignerVerifierStub

type SignerVerifierStub struct {
	SignCalled      func(message []byte) ([]byte, error)
	VerifyCalled    func(message []byte, sig []byte, pk []byte) error
	PublicKeyCalled func() []byte
}

SignerVerifierStub -

func (*SignerVerifierStub) IsInterfaceNil

func (svs *SignerVerifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*SignerVerifierStub) PublicKey

func (svs *SignerVerifierStub) PublicKey() []byte

PublicKey -

func (*SignerVerifierStub) Sign

func (svs *SignerVerifierStub) Sign(message []byte) ([]byte, error)

Sign -

func (*SignerVerifierStub) Verify

func (svs *SignerVerifierStub) Verify(message []byte, sig []byte, pk []byte) error

Verify -

type SyncTimerStub added in v1.0.150

type SyncTimerStub struct {
	CurrentTimeCalled func() time.Time
}

SyncTimerStub -

func (*SyncTimerStub) CurrentTime added in v1.0.150

func (sts *SyncTimerStub) CurrentTime() time.Time

CurrentTime -

func (*SyncTimerStub) IsInterfaceNil added in v1.0.150

func (sts *SyncTimerStub) IsInterfaceNil() bool

IsInterfaceNil -

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL