Documentation
¶
Index ¶
- func NewStreamMock() *streamMock
- type AppStatusHandlerMock
- func (ashm *AppStatusHandlerMock) AddUint64(key string, val uint64)
- func (ashm *AppStatusHandlerMock) Close()
- func (ashm *AppStatusHandlerMock) Decrement(key string)
- func (ashm *AppStatusHandlerMock) GetUint64(key string) uint64
- func (ashm *AppStatusHandlerMock) Increment(key string)
- func (ashm *AppStatusHandlerMock) IsInterfaceNil() bool
- func (ashm *AppStatusHandlerMock) SetInt64Value(key string, value int64)
- func (ashm *AppStatusHandlerMock) SetStringValue(key string, value string)
- func (ashm *AppStatusHandlerMock) SetUInt64Value(key string, value uint64)
- type ChannelLoadBalancerStub
- func (clbs *ChannelLoadBalancerStub) AddChannel(pipe string) error
- func (clbs *ChannelLoadBalancerStub) Close() error
- func (clbs *ChannelLoadBalancerStub) CollectOneElementFromChannels() *p2p.SendableData
- func (clbs *ChannelLoadBalancerStub) GetChannelOrDefault(pipe string) chan *p2p.SendableData
- func (clbs *ChannelLoadBalancerStub) IsInterfaceNil() bool
- func (clbs *ChannelLoadBalancerStub) RemoveChannel(pipe string) error
- type CommonSharder
- type ConnManagerNotifieeStub
- func (cmns *ConnManagerNotifieeStub) Close() error
- func (cmns *ConnManagerNotifieeStub) Connected(netw network.Network, conn network.Conn)
- func (cmns *ConnManagerNotifieeStub) Disconnected(netw network.Network, conn network.Conn)
- func (cmns *ConnManagerNotifieeStub) GetTagInfo(p peer.ID) *connmgr.TagInfo
- func (cmns *ConnManagerNotifieeStub) Listen(netw network.Network, ma multiaddr.Multiaddr)
- func (cmns *ConnManagerNotifieeStub) ListenClose(netw network.Network, ma multiaddr.Multiaddr)
- func (cmns *ConnManagerNotifieeStub) Notifee() network.Notifiee
- func (cmns *ConnManagerNotifieeStub) Protect(id peer.ID, tag string)
- func (cmns *ConnManagerNotifieeStub) TagPeer(p peer.ID, tag string, val int)
- func (cmns *ConnManagerNotifieeStub) TrimOpenConns(ctx context.Context)
- func (cmns *ConnManagerNotifieeStub) Unprotect(id peer.ID, tag string) (protected bool)
- func (cmns *ConnManagerNotifieeStub) UntagPeer(p peer.ID, tag string)
- func (cmns *ConnManagerNotifieeStub) UpsertTag(p peer.ID, tag string, upsert func(int) int)
- type ConnStub
- func (cs *ConnStub) As(target any) bool
- func (cs *ConnStub) Close() error
- func (cs *ConnStub) CloseWithError(errCode network.ConnErrorCode) error
- func (cs *ConnStub) ConnState() network.ConnectionState
- func (cs *ConnStub) GetStreams() []network.Stream
- func (cs *ConnStub) ID() string
- func (cs *ConnStub) IsClosed() bool
- func (cs *ConnStub) LocalMultiaddr() multiaddr.Multiaddr
- func (cs *ConnStub) LocalPeer() peer.ID
- func (cs *ConnStub) LocalPrivateKey() libp2pCrypto.PrivKey
- func (cs *ConnStub) NewStream(ctx context.Context) (network.Stream, error)
- func (cs *ConnStub) RemoteMultiaddr() multiaddr.Multiaddr
- func (cs *ConnStub) RemotePeer() peer.ID
- func (cs *ConnStub) RemotePublicKey() libp2pCrypto.PubKey
- func (cs *ConnStub) Scope() network.ConnScope
- func (cs *ConnStub) Stat() network.ConnStats
- type ConnectableHostStub
- func (hs *ConnectableHostStub) Addrs() []multiaddr.Multiaddr
- func (hs *ConnectableHostStub) Close() error
- func (hs *ConnectableHostStub) ConnManager() connmgr.ConnManager
- func (hs *ConnectableHostStub) Connect(ctx context.Context, pi peer.AddrInfo) error
- func (hs *ConnectableHostStub) ConnectToPeer(ctx context.Context, address string) error
- func (hs *ConnectableHostStub) EventBus() event.Bus
- func (hs *ConnectableHostStub) ID() peer.ID
- func (hs *ConnectableHostStub) IsInterfaceNil() bool
- func (hs *ConnectableHostStub) Mux() protocol.Switch
- func (hs *ConnectableHostStub) Network() network.Network
- func (hs *ConnectableHostStub) NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error)
- func (hs *ConnectableHostStub) Peerstore() peerstore.Peerstore
- func (hs *ConnectableHostStub) RemoveStreamHandler(pid protocol.ID)
- func (hs *ConnectableHostStub) SetStreamHandler(pid protocol.ID, handler network.StreamHandler)
- func (hs *ConnectableHostStub) SetStreamHandlerMatch(pid protocol.ID, handler func(protocol.ID) bool, ...)
- type ConnectionMonitorStub
- func (cms *ConnectionMonitorStub) Connected(netw network.Network, conn network.Conn)
- func (cms *ConnectionMonitorStub) Disconnected(netw network.Network, conn network.Conn)
- func (cms *ConnectionMonitorStub) IsConnectedToTheNetwork(netw network.Network) bool
- func (cms *ConnectionMonitorStub) IsInterfaceNil() bool
- func (cms *ConnectionMonitorStub) Listen(netw network.Network, ma multiaddr.Multiaddr)
- func (cms *ConnectionMonitorStub) ListenClose(netw network.Network, ma multiaddr.Multiaddr)
- func (cms *ConnectionMonitorStub) SetThresholdMinConnectedPeers(thresholdMinConnectedPeers int, netw network.Network)
- func (cms *ConnectionMonitorStub) ThresholdMinConnectedPeers() int
- type ContextProviderMock
- type EventBusStub
- type EventSubscriptionStub
- type MarshalizerStub
- type MessageProcessorStub
- type MultiaddrStub
- func (mas *MultiaddrStub) Bytes() []byte
- func (mas *MultiaddrStub) Decapsulate(multiaddr multiaddr.Multiaddr) multiaddr.Multiaddr
- func (mas *MultiaddrStub) Encapsulate(multiaddr multiaddr.Multiaddr) multiaddr.Multiaddr
- func (mas *MultiaddrStub) Equal(multiaddr multiaddr.Multiaddr) bool
- func (mas *MultiaddrStub) MarshalBinary() (data []byte, err error)
- func (mas *MultiaddrStub) MarshalJSON() ([]byte, error)
- func (mas *MultiaddrStub) MarshalText() (text []byte, err error)
- func (mas *MultiaddrStub) Protocols() []multiaddr.Protocol
- func (mas *MultiaddrStub) String() string
- func (mas *MultiaddrStub) UnmarshalBinary(data []byte) error
- func (mas *MultiaddrStub) UnmarshalJSON(bytes []byte) error
- func (mas *MultiaddrStub) UnmarshalText(text []byte) error
- func (mas *MultiaddrStub) ValueForProtocol(code int) (string, error)
- type NetworkStub
- func (ns *NetworkStub) CanDial(p peer.ID, addr multiaddr.Multiaddr) bool
- func (ns *NetworkStub) Close() error
- func (ns *NetworkStub) ClosePeer(pid peer.ID) error
- func (ns *NetworkStub) Connectedness(pid peer.ID) network.Connectedness
- func (ns *NetworkStub) Conns() []network.Conn
- func (ns *NetworkStub) ConnsToPeer(p peer.ID) []network.Conn
- func (ns *NetworkStub) DialPeer(_ context.Context, _ peer.ID) (network.Conn, error)
- func (ns *NetworkStub) InterfaceListenAddresses() ([]multiaddr.Multiaddr, error)
- func (ns *NetworkStub) Listen(...multiaddr.Multiaddr) error
- func (ns *NetworkStub) ListenAddresses() []multiaddr.Multiaddr
- func (ns *NetworkStub) LocalPeer() peer.ID
- func (ns *NetworkStub) NewStream(context.Context, peer.ID) (network.Stream, error)
- func (ns *NetworkStub) Notify(notifee network.Notifiee)
- func (ns *NetworkStub) Peers() []peer.ID
- func (ns *NetworkStub) Peerstore() peerstore.Peerstore
- func (ns *NetworkStub) Process() goprocess.Process
- func (ns *NetworkStub) ResourceManager() network.ResourceManager
- func (ns *NetworkStub) SetConnHandler(network.Conn)
- func (ns *NetworkStub) SetStreamHandler(network.StreamHandler)
- func (ns *NetworkStub) StopNotify(notifee network.Notifiee)
- type P2PMessageMock
- func (msg *P2PMessageMock) Data() []byte
- func (msg *P2PMessageMock) From() []byte
- func (msg *P2PMessageMock) IsInterfaceNil() bool
- func (msg *P2PMessageMock) Key() []byte
- func (msg *P2PMessageMock) Payload() []byte
- func (msg *P2PMessageMock) Peer() core.PeerID
- func (msg *P2PMessageMock) SeqNo() []byte
- func (msg *P2PMessageMock) Signature() []byte
- func (msg *P2PMessageMock) Timestamp() int64
- func (msg *P2PMessageMock) Topics() []string
- type PeerDenialEvaluatorStub
- type PeerDiscovererStub
- type PeerShardResolverStub
- type PeerstoreStub
- func (ps *PeerstoreStub) AddAddr(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration)
- func (ps *PeerstoreStub) AddAddrs(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration)
- func (ps *PeerstoreStub) AddPrivKey(id peer.ID, key libp2pCrypto.PrivKey) error
- func (ps *PeerstoreStub) AddProtocols(id peer.ID, s ...protocol.ID) error
- func (ps *PeerstoreStub) AddPubKey(id peer.ID, key libp2pCrypto.PubKey) error
- func (ps *PeerstoreStub) AddrStream(ctx context.Context, id peer.ID) <-chan multiaddr.Multiaddr
- func (ps *PeerstoreStub) Addrs(p peer.ID) []multiaddr.Multiaddr
- func (ps *PeerstoreStub) ClearAddrs(p peer.ID)
- func (ps *PeerstoreStub) Close() error
- func (ps *PeerstoreStub) FirstSupportedProtocol(id peer.ID, s ...protocol.ID) (protocol.ID, error)
- func (ps *PeerstoreStub) Get(p peer.ID, key string) (interface{}, error)
- func (ps *PeerstoreStub) GetProtocols(id peer.ID) ([]protocol.ID, error)
- func (ps *PeerstoreStub) LatencyEWMA(id peer.ID) time.Duration
- func (ps *PeerstoreStub) PeerInfo(id peer.ID) peer.AddrInfo
- func (ps *PeerstoreStub) Peers() peer.IDSlice
- func (ps *PeerstoreStub) PeersWithAddrs() peer.IDSlice
- func (ps *PeerstoreStub) PeersWithKeys() peer.IDSlice
- func (ps *PeerstoreStub) PrivKey(id peer.ID) libp2pCrypto.PrivKey
- func (ps *PeerstoreStub) PubKey(id peer.ID) libp2pCrypto.PubKey
- func (ps *PeerstoreStub) Put(p peer.ID, key string, val interface{}) error
- func (ps *PeerstoreStub) RecordLatency(id peer.ID, duration time.Duration)
- func (ps *PeerstoreStub) RemovePeer(id peer.ID)
- func (ps *PeerstoreStub) RemoveProtocols(id peer.ID, s ...protocol.ID) error
- func (ps *PeerstoreStub) SetAddr(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration)
- func (ps *PeerstoreStub) SetAddrs(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration)
- func (ps *PeerstoreStub) SetProtocols(id peer.ID, s ...protocol.ID) error
- func (ps *PeerstoreStub) SupportsProtocols(id peer.ID, s ...protocol.ID) ([]protocol.ID, error)
- func (ps *PeerstoreStub) UpdateAddrs(p peer.ID, oldTTL time.Duration, newTTL time.Duration)
- type ReconnecterStub
- type SharderStub
- type SyncTimerStub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppStatusHandlerMock ¶
type AppStatusHandlerMock struct {
// contains filtered or unexported fields
}
AppStatusHandlerMock -
func NewAppStatusHandlerMock ¶
func NewAppStatusHandlerMock() *AppStatusHandlerMock
NewAppStatusHandlerMock -
func (*AppStatusHandlerMock) AddUint64 ¶
func (ashm *AppStatusHandlerMock) AddUint64(key string, val uint64)
AddUint64 -
func (*AppStatusHandlerMock) Decrement ¶
func (ashm *AppStatusHandlerMock) Decrement(key string)
Decrement -
func (*AppStatusHandlerMock) GetUint64 ¶
func (ashm *AppStatusHandlerMock) GetUint64(key string) uint64
GetUint64 -
func (*AppStatusHandlerMock) Increment ¶
func (ashm *AppStatusHandlerMock) Increment(key string)
Increment -
func (*AppStatusHandlerMock) IsInterfaceNil ¶
func (ashm *AppStatusHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AppStatusHandlerMock) SetInt64Value ¶
func (ashm *AppStatusHandlerMock) SetInt64Value(key string, value int64)
SetInt64Value -
func (*AppStatusHandlerMock) SetStringValue ¶
func (ashm *AppStatusHandlerMock) SetStringValue(key string, value string)
SetStringValue -
func (*AppStatusHandlerMock) SetUInt64Value ¶
func (ashm *AppStatusHandlerMock) SetUInt64Value(key string, value uint64)
SetUInt64Value -
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) 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 CommonSharder ¶
type CommonSharder struct {
SetPeerShardResolverCalled func(psp p2p.PeerShardResolver) error
}
CommonSharder -
func (*CommonSharder) IsInterfaceNil ¶
func (cs *CommonSharder) IsInterfaceNil() bool
IsInterfaceNil -
func (*CommonSharder) SetPeerShardResolver ¶
func (cs *CommonSharder) SetPeerShardResolver(psp p2p.PeerShardResolver) error
SetPeerShardResolver -
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)
}
ConnManagerNotifieeStub -
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) 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 -
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.ConnStats
ConnStateCalled func() network.ConnectionState
ConnScopeCalled func() network.ConnScope
AsCalled func(target any) bool
}
ConnStub -
func (*ConnStub) CloseWithError ¶
func (cs *ConnStub) CloseWithError(errCode network.ConnErrorCode) error
CloseWithError -
func (*ConnStub) LocalMultiaddr ¶
LocalMultiaddr -
func (*ConnStub) LocalPrivateKey ¶
func (cs *ConnStub) LocalPrivateKey() libp2pCrypto.PrivKey
LocalPrivateKey -
func (*ConnStub) RemoteMultiaddr ¶
RemoteMultiaddr -
func (*ConnStub) RemotePublicKey ¶
func (cs *ConnStub) RemotePublicKey() libp2pCrypto.PubKey
RemotePublicKey -
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(protocol.ID) 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
}
ConnectableHostStub -
func (*ConnectableHostStub) Addrs ¶
func (hs *ConnectableHostStub) Addrs() []multiaddr.Multiaddr
Addrs -
func (*ConnectableHostStub) ConnManager ¶
func (hs *ConnectableHostStub) ConnManager() connmgr.ConnManager
ConnManager -
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) IsInterfaceNil ¶
func (hs *ConnectableHostStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
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(protocol.ID) 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)
IsConnectedToTheNetworkCalled func(netw network.Network) bool
SetThresholdMinConnectedPeersCalled func(thresholdMinConnectedPeers int, netw network.Network)
ThresholdMinConnectedPeersCalled func() int
}
ConnectionMonitorStub -
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) 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 ¶
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 ¶
func (ebs *EventBusStub) Emitter(eventType interface{}, opts ...event.EmitterOpt) (event.Emitter, error)
Emitter -
func (*EventBusStub) GetAllEventTypes ¶
func (ebs *EventBusStub) GetAllEventTypes() []reflect.Type
GetAllEventTypes -
func (*EventBusStub) Subscribe ¶
func (ebs *EventBusStub) Subscribe(eventType interface{}, opts ...event.SubscriptionOpt) (event.Subscription, error)
Subscribe -
type EventSubscriptionStub ¶
type EventSubscriptionStub struct {
CloseCalled func() error
OutCalled func() <-chan interface{}
NameCalled func() string
}
EventSubscriptionStub -
func (*EventSubscriptionStub) Out ¶
func (ess *EventSubscriptionStub) Out() <-chan interface{}
Out -
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 ¶
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) Decapsulate ¶
func (mas *MultiaddrStub) Decapsulate(multiaddr multiaddr.Multiaddr) multiaddr.Multiaddr
Decapsulate -
func (*MultiaddrStub) Encapsulate ¶
func (mas *MultiaddrStub) Encapsulate(multiaddr multiaddr.Multiaddr) multiaddr.Multiaddr
Encapsulate -
func (*MultiaddrStub) Equal ¶
func (mas *MultiaddrStub) Equal(multiaddr multiaddr.Multiaddr) bool
Equal -
func (*MultiaddrStub) MarshalBinary ¶
func (mas *MultiaddrStub) MarshalBinary() (data []byte, err error)
MarshalBinary -
func (*MultiaddrStub) MarshalJSON ¶
func (mas *MultiaddrStub) MarshalJSON() ([]byte, error)
MarshalJSON -
func (*MultiaddrStub) MarshalText ¶
func (mas *MultiaddrStub) MarshalText() (text []byte, err error)
MarshalText -
func (*MultiaddrStub) Protocols ¶
func (mas *MultiaddrStub) Protocols() []multiaddr.Protocol
Protocols -
func (*MultiaddrStub) UnmarshalBinary ¶
func (mas *MultiaddrStub) UnmarshalBinary(data []byte) error
UnmarshalBinary -
func (*MultiaddrStub) UnmarshalJSON ¶
func (mas *MultiaddrStub) UnmarshalJSON(bytes []byte) error
UnmarshalJSON -
func (*MultiaddrStub) UnmarshalText ¶
func (mas *MultiaddrStub) UnmarshalText(text []byte) error
UnmarshalText -
func (*MultiaddrStub) ValueForProtocol ¶
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) Connectedness ¶
func (ns *NetworkStub) Connectedness(pid peer.ID) network.Connectedness
Connectedness -
func (*NetworkStub) ConnsToPeer ¶
func (ns *NetworkStub) ConnsToPeer(p peer.ID) []network.Conn
ConnsToPeer -
func (*NetworkStub) InterfaceListenAddresses ¶
func (ns *NetworkStub) InterfaceListenAddresses() ([]multiaddr.Multiaddr, error)
InterfaceListenAddresses -
func (*NetworkStub) ListenAddresses ¶
func (ns *NetworkStub) ListenAddresses() []multiaddr.Multiaddr
ListenAddresses -
func (*NetworkStub) ResourceManager ¶
func (ns *NetworkStub) ResourceManager() network.ResourceManager
ResourceManager -
func (*NetworkStub) SetConnHandler ¶
func (ns *NetworkStub) SetConnHandler(network.Conn)
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
TopicsField []string
SignatureField []byte
KeyField []byte
PeerField core.PeerID
PayloadField []byte
TimestampField int64
}
P2PMessageMock -
func (*P2PMessageMock) IsInterfaceNil ¶
func (msg *P2PMessageMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type PeerDenialEvaluatorStub ¶
type PeerDenialEvaluatorStub struct {
UpsertPeerIDCalled func(pid core.PeerID, duration time.Duration) error
IsDeniedCalled func(pid core.PeerID) bool
}
PeerDenialEvaluatorStub -
func (*PeerDenialEvaluatorStub) IsDenied ¶
func (pdes *PeerDenialEvaluatorStub) IsDenied(pid core.PeerID) bool
IsDenied -
func (*PeerDenialEvaluatorStub) IsInterfaceNil ¶
func (pdes *PeerDenialEvaluatorStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*PeerDenialEvaluatorStub) UpsertPeerID ¶
UpsertPeerID -
type PeerDiscovererStub ¶
PeerDiscovererStub -
func (*PeerDiscovererStub) IsInterfaceNil ¶
func (pds *PeerDiscovererStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
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 ¶
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) ([]protocol.ID, error)
AddProtocolsCalled func(id peer.ID, s ...protocol.ID) error
SetProtocolsCalled func(id peer.ID, s ...protocol.ID) error
RemoveProtocolsCalled func(id peer.ID, s ...protocol.ID) error
SupportsProtocolsCalled func(id peer.ID, s ...protocol.ID) ([]protocol.ID, error)
FirstSupportedProtocolCalled func(id peer.ID, s ...protocol.ID) (protocol.ID, error)
PeerInfoCalled func(id peer.ID) peer.AddrInfo
PeersCalled func() peer.IDSlice
RemovePeerCalled func(id peer.ID)
}
PeerstoreStub -
func (*PeerstoreStub) AddPrivKey ¶
func (ps *PeerstoreStub) AddPrivKey(id peer.ID, key libp2pCrypto.PrivKey) error
AddPrivKey -
func (*PeerstoreStub) AddProtocols ¶
AddProtocols -
func (*PeerstoreStub) AddPubKey ¶
func (ps *PeerstoreStub) AddPubKey(id peer.ID, key libp2pCrypto.PubKey) error
AddPubKey -
func (*PeerstoreStub) AddrStream ¶
AddrStream -
func (*PeerstoreStub) Addrs ¶
func (ps *PeerstoreStub) Addrs(p peer.ID) []multiaddr.Multiaddr
Addrs -
func (*PeerstoreStub) FirstSupportedProtocol ¶
FirstSupportedProtocol -
func (*PeerstoreStub) Get ¶
func (ps *PeerstoreStub) Get(p peer.ID, key string) (interface{}, error)
Get -
func (*PeerstoreStub) GetProtocols ¶
GetProtocols -
func (*PeerstoreStub) LatencyEWMA ¶
func (ps *PeerstoreStub) LatencyEWMA(id peer.ID) time.Duration
LatencyEWMA -
func (*PeerstoreStub) PeerInfo ¶
func (ps *PeerstoreStub) PeerInfo(id peer.ID) peer.AddrInfo
PeerInfo -
func (*PeerstoreStub) PeersWithAddrs ¶
func (ps *PeerstoreStub) PeersWithAddrs() peer.IDSlice
PeersWithAddrs -
func (*PeerstoreStub) PeersWithKeys ¶
func (ps *PeerstoreStub) PeersWithKeys() peer.IDSlice
PeersWithKeys -
func (*PeerstoreStub) PrivKey ¶
func (ps *PeerstoreStub) PrivKey(id peer.ID) libp2pCrypto.PrivKey
PrivKey -
func (*PeerstoreStub) PubKey ¶
func (ps *PeerstoreStub) PubKey(id peer.ID) libp2pCrypto.PubKey
PubKey -
func (*PeerstoreStub) Put ¶
func (ps *PeerstoreStub) Put(p peer.ID, key string, val interface{}) error
Put -
func (*PeerstoreStub) RecordLatency ¶
func (ps *PeerstoreStub) RecordLatency(id peer.ID, duration time.Duration)
RecordLatency -
func (*PeerstoreStub) RemoveProtocols ¶
RemoveProtocols -
func (*PeerstoreStub) SetProtocols ¶
SetProtocols -
func (*PeerstoreStub) SupportsProtocols ¶
SupportsProtocols -
func (*PeerstoreStub) UpdateAddrs ¶
UpdateAddrs -
type ReconnecterStub ¶
type ReconnecterStub struct {
ReconnectToNetworkCalled func() <-chan struct{}
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() <-chan struct{}
ReconnectToNetwork -
type SharderStub ¶
type SharderStub struct {
ComputeEvictListCalled func(pidList []peer.ID) []peer.ID
HasCalled func(pid peer.ID, list []peer.ID) bool
SetPeerShardResolverCalled func(psp p2p.PeerShardResolver) error
}
SharderStub -
func (*SharderStub) ComputeEvictionList ¶
func (ss *SharderStub) ComputeEvictionList(pidList []peer.ID) []peer.ID
ComputeEvictionList -
func (*SharderStub) SetPeerShardResolver ¶
func (ss *SharderStub) SetPeerShardResolver(psp p2p.PeerShardResolver) error
SetPeerShardResolver -
type SyncTimerStub ¶
SyncTimerStub -
func (*SyncTimerStub) IsInterfaceNil ¶
func (sts *SyncTimerStub) IsInterfaceNil() bool
IsInterfaceNil -
Source Files
¶
- appStatusHandlerMock.go
- channelLoadBalancerStub.go
- commonSharder.go
- connManagerNotifieeStub.go
- connStub.go
- connectableHostStub.go
- connectionMonitorStub.go
- contextProviderMock.go
- eventBusStub.go
- eventSubscriptionStub.go
- marshalizerStub.go
- messageProcessorStub.go
- multiaddrStub.go
- networkStub.go
- p2pMessageMock.go
- peerDenialEvaluatorStub.go
- peerDiscovererStub.go
- peerShardResolverStub.go
- peerstoreStub.go
- reconnecterStub.go
- sharderStub.go
- streamMock.go
- syncTimerStub.go