Documentation ¶
Index ¶
- func NewNetworkShardingCollectorMock() *networkShardingCollectorMock
- func NewPrivateKeyMock() *privateKeyMock
- func NewStreamMock() *streamMock
- type CacherStub
- func (cacher *CacherStub) Clear()
- func (cacher *CacherStub) Close() error
- func (cacher *CacherStub) Get(key []byte) (value interface{}, ok bool)
- func (cacher *CacherStub) Has(key []byte) bool
- func (cacher *CacherStub) HasOrAdd(key []byte, value interface{}, sizeInBytes int) (has, added bool)
- func (cacher *CacherStub) IsInterfaceNil() bool
- func (cacher *CacherStub) Keys() [][]byte
- func (cacher *CacherStub) Len() int
- func (cacher *CacherStub) MaxSize() int
- func (cacher *CacherStub) Peek(key []byte) (value interface{}, ok bool)
- func (cacher *CacherStub) Put(key []byte, value interface{}, sizeInBytes int) (evicted bool)
- func (cacher *CacherStub) RegisterHandler(handler func(key []byte, value interface{}), _ string)
- func (cacher *CacherStub) Remove(key []byte)
- func (cacher *CacherStub) SizeInBytesContained() uint64
- func (cacher *CacherStub) UnRegisterHandler(id string)
- type ChannelLoadBalancerStub
- func (clbs *ChannelLoadBalancerStub) AddChannel(pipe string) error
- func (clbs *ChannelLoadBalancerStub) Close() error
- func (clbs *ChannelLoadBalancerStub) CollectOneElementFromChannels() *libp2p.SendableData
- func (clbs *ChannelLoadBalancerStub) GetChannelOrDefault(pipe string) chan *libp2p.SendableData
- func (clbs *ChannelLoadBalancerStub) IsInterfaceNil() bool
- func (clbs *ChannelLoadBalancerStub) RemoveChannel(pipe string) error
- type ConnStub
- func (cs *ConnStub) Close() 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) AddressToPeerInfo(address string) (*peer.AddrInfo, error)
- 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(id protocol.ID, f func(protocol.ID) bool, handler network.StreamHandler)
- type ConnectionMonitorStub
- func (cms *ConnectionMonitorStub) Close() error
- 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) PeerDenialEvaluator() p2p.PeerDenialEvaluator
- func (cms *ConnectionMonitorStub) SetPeerDenialEvaluator(handler p2p.PeerDenialEvaluator) error
- func (cms *ConnectionMonitorStub) SetThresholdMinConnectedPeers(thresholdMinConnectedPeers int, netw network.Network)
- func (cms *ConnectionMonitorStub) ThresholdMinConnectedPeers() int
- type ConnectionsMetricStub
- func (stub *ConnectionsMetricStub) Connected(network core.Network, conn core.Conn)
- func (stub *ConnectionsMetricStub) Disconnected(network core.Network, conn core.Conn)
- func (stub *ConnectionsMetricStub) IsInterfaceNil() bool
- func (stub *ConnectionsMetricStub) Listen(network core.Network, addr core.Multiaddr)
- func (stub *ConnectionsMetricStub) ListenClose(network core.Network, addr core.Multiaddr)
- func (stub *ConnectionsMetricStub) ResetNumConnections() uint32
- func (stub *ConnectionsMetricStub) ResetNumDisconnections() uint32
- type ConnectionsWatcherStub
- type DebuggerStub
- type DirectSenderStub
- type EventBusStub
- type EventSubscriptionStub
- type KadDhtHandlerStub
- type KadSharderStub
- func (kss *KadSharderStub) ComputeEvictionList(pidList []peer.ID) []peer.ID
- func (kss *KadSharderStub) Has(pid peer.ID, list []peer.ID) bool
- func (kss *KadSharderStub) IsInterfaceNil() bool
- func (kss *KadSharderStub) IsSeeder(pid core.PeerID) bool
- func (kss *KadSharderStub) SetPeerShardResolver(psp p2p.PeerShardResolver) error
- func (kss *KadSharderStub) SetSeeders(addresses []string)
- type KeyGenStub
- func (keyGen *KeyGenStub) CheckPublicKeyValid(b []byte) error
- func (keyGen *KeyGenStub) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
- func (keyGen *KeyGenStub) IsInterfaceNil() bool
- func (keyGen *KeyGenStub) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)
- func (keyGen *KeyGenStub) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)
- func (keyGen *KeyGenStub) Suite() crypto.Suite
- type MessageHandlerStub
- func (stub *MessageHandlerStub) Broadcast(topic string, buff []byte)
- func (stub *MessageHandlerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
- func (stub *MessageHandlerStub) BroadcastOnChannelUsingPrivateKey(channel string, topic string, buff []byte, pid core.PeerID, skBytes []byte)
- func (stub *MessageHandlerStub) BroadcastUsingPrivateKey(topic string, buff []byte, pid core.PeerID, skBytes []byte)
- func (stub *MessageHandlerStub) Close() error
- func (stub *MessageHandlerStub) CreateTopic(name string, createChannelForTopic bool) error
- func (stub *MessageHandlerStub) HasTopic(name string) bool
- func (stub *MessageHandlerStub) IsInterfaceNil() bool
- func (stub *MessageHandlerStub) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID, ...) error
- func (stub *MessageHandlerStub) RegisterMessageProcessor(topic string, identifier string, handler p2p.MessageProcessor) error
- func (stub *MessageHandlerStub) SendToConnectedPeer(topic string, buff []byte, peerID core.PeerID) error
- func (stub *MessageHandlerStub) SetDebugger(debugger p2p.Debugger) error
- func (stub *MessageHandlerStub) UnJoinAllTopics() error
- func (stub *MessageHandlerStub) UnregisterAllMessageProcessors() error
- func (stub *MessageHandlerStub) UnregisterMessageProcessor(topic string, identifier string) error
- type MessageProcessorMock
- 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) 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) SetStreamHandler(network.StreamHandler)
- func (ns *NetworkStub) StopNotify(notifee network.Notifiee)
- type P2PSignerStub
- type PeerDenialEvaluatorStub
- type PeerDiscovererStub
- type PeerShardResolverStub
- type PeerTopicNotifierStub
- type PeersHolderStub
- func (p *PeersHolderStub) Clear()
- func (p *PeersHolderStub) Contains(peerID core.PeerID) bool
- func (p *PeersHolderStub) Get() map[uint32][]core.PeerID
- func (p *PeersHolderStub) IsInterfaceNil() bool
- func (p *PeersHolderStub) PutConnectionAddress(peerID core.PeerID, address string)
- func (p *PeersHolderStub) PutShardID(peerID core.PeerID, shardID uint32)
- func (p *PeersHolderStub) Remove(peerID core.PeerID)
- type PeersOnChannelStub
- type PeersRatingHandlerStub
- func (stub *PeersRatingHandlerStub) DecreaseRating(pid core.PeerID)
- func (stub *PeersRatingHandlerStub) GetTopRatedPeersFromList(peers []core.PeerID, numOfPeers int) []core.PeerID
- func (stub *PeersRatingHandlerStub) IncreaseRating(pid core.PeerID)
- func (stub *PeersRatingHandlerStub) IsInterfaceNil() bool
- 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, id2 ...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, id2 ...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, id2 ...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, id2 ...protocol.ID) error
- func (ps *PeerstoreStub) SupportsProtocols(id peer.ID, id2 ...protocol.ID) ([]protocol.ID, error)
- func (ps *PeerstoreStub) UpdateAddrs(p peer.ID, oldTTL time.Duration, newTTL time.Duration)
- type PrivateKeyStub
- type PubSubStub
- func (stub *PubSubStub) GetTopics() []string
- func (stub *PubSubStub) Join(topic string, opts ...pubsub.TopicOpt) (*pubsub.Topic, error)
- func (stub *PubSubStub) ListPeers(topic string) []peer.ID
- func (stub *PubSubStub) RegisterTopicValidator(topic string, val interface{}, opts ...pubsub.ValidatorOpt) error
- func (stub *PubSubStub) UnregisterTopicValidator(topic string) error
- type PubSubSubscriptionStub
- type PubSubTopicStub
- type PublicKeyStub
- type ReconnecterStub
- type SharderStub
- type SingleSignerStub
- type SyncTimerStub
- type ThrottlerStub
- type TopicProcessorStub
- func (stub *TopicProcessorStub) AddTopicProcessor(identifier string, processor p2p.MessageProcessor) error
- func (stub *TopicProcessorStub) GetList() ([]string, []p2p.MessageProcessor)
- func (stub *TopicProcessorStub) IsInterfaceNil() bool
- func (stub *TopicProcessorStub) RemoveTopicProcessor(identifier string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNetworkShardingCollectorMock ¶
func NewNetworkShardingCollectorMock() *networkShardingCollectorMock
NewNetworkShardingCollectorMock -
func NewPrivateKeyMock ¶
func NewPrivateKeyMock() *privateKeyMock
NewPrivateKeyMock will create a new PrivateKeyMock instance
Types ¶
type CacherStub ¶
type CacherStub struct { ClearCalled func() PutCalled func(key []byte, value interface{}, sizeInBytes int) (evicted bool) GetCalled func(key []byte) (value interface{}, ok bool) HasCalled func(key []byte) bool PeekCalled func(key []byte) (value interface{}, ok bool) HasOrAddCalled func(key []byte, value interface{}, sizeInBytes int) (has, added bool) RemoveCalled func(key []byte) RemoveOldestCalled func() KeysCalled func() [][]byte LenCalled func() int MaxSizeCalled func() int RegisterHandlerCalled func(func(key []byte, value interface{})) UnRegisterHandlerCalled func(id string) CloseCalled func() error }
CacherStub -
func (*CacherStub) Get ¶
func (cacher *CacherStub) Get(key []byte) (value interface{}, ok bool)
Get -
func (*CacherStub) HasOrAdd ¶
func (cacher *CacherStub) HasOrAdd(key []byte, value interface{}, sizeInBytes int) (has, added bool)
HasOrAdd -
func (*CacherStub) IsInterfaceNil ¶
func (cacher *CacherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherStub) Peek ¶
func (cacher *CacherStub) Peek(key []byte) (value interface{}, ok bool)
Peek -
func (*CacherStub) Put ¶
func (cacher *CacherStub) Put(key []byte, value interface{}, sizeInBytes int) (evicted bool)
Put -
func (*CacherStub) RegisterHandler ¶
func (cacher *CacherStub) RegisterHandler(handler func(key []byte, value interface{}), _ string)
RegisterHandler -
func (*CacherStub) SizeInBytesContained ¶
func (cacher *CacherStub) SizeInBytesContained() uint64
SizeInBytesContained -
func (*CacherStub) UnRegisterHandler ¶
func (cacher *CacherStub) UnRegisterHandler(id string)
UnRegisterHandler -
type ChannelLoadBalancerStub ¶
type ChannelLoadBalancerStub struct { AddChannelCalled func(pipe string) error RemoveChannelCalled func(pipe string) error GetChannelOrDefaultCalled func(pipe string) chan *libp2p.SendableData CollectOneElementFromChannelsCalled func() *libp2p.SendableData CloseCalled func() error }
ChannelLoadBalancerStub -
func (*ChannelLoadBalancerStub) AddChannel ¶
func (clbs *ChannelLoadBalancerStub) AddChannel(pipe string) error
AddChannel -
func (*ChannelLoadBalancerStub) CollectOneElementFromChannels ¶
func (clbs *ChannelLoadBalancerStub) CollectOneElementFromChannels() *libp2p.SendableData
CollectOneElementFromChannels -
func (*ChannelLoadBalancerStub) GetChannelOrDefault ¶
func (clbs *ChannelLoadBalancerStub) GetChannelOrDefault(pipe string) chan *libp2p.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 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 ScopeCalled func() network.ConnScope ConnStateCalled func() network.ConnectionState IsClosedCalled func() bool }
ConnStub -
func (*ConnStub) LocalMultiaddr ¶
func (cs *ConnStub) LocalMultiaddr() multiaddr.Multiaddr
LocalMultiaddr -
func (*ConnStub) LocalPrivateKey ¶
func (cs *ConnStub) LocalPrivateKey() libp2pCrypto.PrivKey
LocalPrivateKey -
func (*ConnStub) RemoteMultiaddr ¶
func (cs *ConnStub) RemoteMultiaddr() multiaddr.Multiaddr
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(id protocol.ID, f func(protocol.ID) bool, handler 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 ¶
func (hs *ConnectableHostStub) AddressToPeerInfo(address string) (*peer.AddrInfo, error)
AddressToPeerInfo -
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(id protocol.ID, f func(protocol.ID) bool, handler 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 SetPeerDenialEvaluatorCalled func(handler p2p.PeerDenialEvaluator) error PeerDenialEvaluatorCalled func() p2p.PeerDenialEvaluator CloseCalled func() error }
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) PeerDenialEvaluator ¶
func (cms *ConnectionMonitorStub) PeerDenialEvaluator() p2p.PeerDenialEvaluator
PeerDenialEvaluator -
func (*ConnectionMonitorStub) SetPeerDenialEvaluator ¶
func (cms *ConnectionMonitorStub) SetPeerDenialEvaluator(handler p2p.PeerDenialEvaluator) error
SetPeerDenialEvaluator -
func (*ConnectionMonitorStub) SetThresholdMinConnectedPeers ¶
func (cms *ConnectionMonitorStub) SetThresholdMinConnectedPeers(thresholdMinConnectedPeers int, netw network.Network)
SetThresholdMinConnectedPeers -
func (*ConnectionMonitorStub) ThresholdMinConnectedPeers ¶
func (cms *ConnectionMonitorStub) ThresholdMinConnectedPeers() int
ThresholdMinConnectedPeers -
type ConnectionsMetricStub ¶
type ConnectionsMetricStub struct { ResetNumConnectionsCalled func() uint32 ResetNumDisconnectionsCalled func() uint32 ListenCalled func(core.Network, core.Multiaddr) ListenCloseCalled func(core.Network, core.Multiaddr) ConnectedCalled func(core.Network, core.Conn) DisconnectedCalled func(core.Network, core.Conn) }
ConnectionsMetricStub -
func (*ConnectionsMetricStub) Connected ¶
func (stub *ConnectionsMetricStub) Connected(network core.Network, conn core.Conn)
Connected -
func (*ConnectionsMetricStub) Disconnected ¶
func (stub *ConnectionsMetricStub) Disconnected(network core.Network, conn core.Conn)
Disconnected -
func (*ConnectionsMetricStub) IsInterfaceNil ¶
func (stub *ConnectionsMetricStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ConnectionsMetricStub) Listen ¶
func (stub *ConnectionsMetricStub) Listen(network core.Network, addr core.Multiaddr)
Listen -
func (*ConnectionsMetricStub) ListenClose ¶
func (stub *ConnectionsMetricStub) ListenClose(network core.Network, addr core.Multiaddr)
ListenClose -
func (*ConnectionsMetricStub) ResetNumConnections ¶
func (stub *ConnectionsMetricStub) ResetNumConnections() uint32
ResetNumConnections -
func (*ConnectionsMetricStub) ResetNumDisconnections ¶
func (stub *ConnectionsMetricStub) ResetNumDisconnections() uint32
ResetNumDisconnections -
type ConnectionsWatcherStub ¶
type ConnectionsWatcherStub struct { NewKnownConnectionCalled func(pid core.PeerID, connection string) CloseCalled func() error }
ConnectionsWatcherStub -
func (*ConnectionsWatcherStub) IsInterfaceNil ¶
func (stub *ConnectionsWatcherStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ConnectionsWatcherStub) NewKnownConnection ¶
func (stub *ConnectionsWatcherStub) NewKnownConnection(pid core.PeerID, connection string)
NewKnownConnection -
type DebuggerStub ¶
type DebuggerStub struct { AddIncomingMessageCalled func(topic string, size uint64, isRejected bool) AddOutgoingMessageCalled func(topic string, size uint64, isRejected bool) CloseCalled func() error }
DebuggerStub -
func (*DebuggerStub) AddIncomingMessage ¶
func (stub *DebuggerStub) AddIncomingMessage(topic string, size uint64, isRejected bool)
AddIncomingMessage -
func (*DebuggerStub) AddOutgoingMessage ¶
func (stub *DebuggerStub) AddOutgoingMessage(topic string, size uint64, isRejected bool)
AddOutgoingMessage -
func (*DebuggerStub) IsInterfaceNil ¶
func (stub *DebuggerStub) IsInterfaceNil() bool
IsInterfaceNil -
type DirectSenderStub ¶
type DirectSenderStub struct { NextSequenceNumberCalled func() []byte SendCalled func(topic string, buff []byte, peer core.PeerID) error RegisterDirectMessageProcessorCalled func(handler p2p.MessageHandler) error }
DirectSenderStub -
func (*DirectSenderStub) IsInterfaceNil ¶
func (stub *DirectSenderStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*DirectSenderStub) NextSequenceNumber ¶
func (stub *DirectSenderStub) NextSequenceNumber() []byte
NextSequenceNumber -
func (*DirectSenderStub) RegisterDirectMessageProcessor ¶
func (stub *DirectSenderStub) RegisterDirectMessageProcessor(handler p2p.MessageHandler) error
RegisterDirectMessageProcessor -
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 KadDhtHandlerStub ¶
KadDhtHandlerStub -
type KadSharderStub ¶
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 ¶
func (kss *KadSharderStub) ComputeEvictionList(pidList []peer.ID) []peer.ID
ComputeEvictionList -
func (*KadSharderStub) IsInterfaceNil ¶
func (kss *KadSharderStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*KadSharderStub) IsSeeder ¶
func (kss *KadSharderStub) IsSeeder(pid core.PeerID) bool
IsSeeder -
func (*KadSharderStub) SetPeerShardResolver ¶
func (kss *KadSharderStub) SetPeerShardResolver(psp p2p.PeerShardResolver) error
SetPeerShardResolver -
func (*KadSharderStub) SetSeeders ¶
func (kss *KadSharderStub) SetSeeders(addresses []string)
SetSeeders -
type KeyGenStub ¶
type KeyGenStub struct { GeneratePairStub func() (crypto.PrivateKey, crypto.PublicKey) PrivateKeyFromByteArrayStub func(b []byte) (crypto.PrivateKey, error) PublicKeyFromByteArrayStub func(b []byte) (crypto.PublicKey, error) CheckPublicKeyValidStub func(b []byte) error SuiteStub func() crypto.Suite }
KeyGenStub mocks a key generation implementation
func (*KeyGenStub) CheckPublicKeyValid ¶
func (keyGen *KeyGenStub) CheckPublicKeyValid(b []byte) error
CheckPublicKeyValid verifies the validity of the public key
func (*KeyGenStub) GeneratePair ¶
func (keyGen *KeyGenStub) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
GeneratePair generates a pair of private and public keys
func (*KeyGenStub) IsInterfaceNil ¶
func (keyGen *KeyGenStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*KeyGenStub) PrivateKeyFromByteArray ¶
func (keyGen *KeyGenStub) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)
PrivateKeyFromByteArray generates the private key from its byte array representation
func (*KeyGenStub) PublicKeyFromByteArray ¶
func (keyGen *KeyGenStub) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)
PublicKeyFromByteArray generates a public key from its byte array representation
type MessageHandlerStub ¶
type MessageHandlerStub struct { CreateTopicCalled func(name string, createChannelForTopic bool) error HasTopicCalled func(name string) bool RegisterMessageProcessorCalled func(topic string, identifier string, handler p2p.MessageProcessor) error UnregisterAllMessageProcessorsCalled func() error UnregisterMessageProcessorCalled func(topic string, identifier string) error BroadcastCalled func(topic string, buff []byte) BroadcastOnChannelCalled func(channel string, topic string, buff []byte) BroadcastUsingPrivateKeyCalled func(topic string, buff []byte, pid core.PeerID, skBytes []byte) BroadcastOnChannelUsingPrivateKeyCalled func(channel string, topic string, buff []byte, pid core.PeerID, skBytes []byte) SendToConnectedPeerCalled func(topic string, buff []byte, peerID core.PeerID) error UnJoinAllTopicsCalled func() error ProcessReceivedMessageCalled func(message p2p.MessageP2P, fromConnectedPeer core.PeerID, source p2p.MessageHandler) error SetDebuggerCalled func(debugger p2p.Debugger) error CloseCalled func() error }
MessageHandlerStub -
func (*MessageHandlerStub) Broadcast ¶
func (stub *MessageHandlerStub) Broadcast(topic string, buff []byte)
Broadcast -
func (*MessageHandlerStub) BroadcastOnChannel ¶
func (stub *MessageHandlerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
BroadcastOnChannel -
func (*MessageHandlerStub) BroadcastOnChannelUsingPrivateKey ¶
func (stub *MessageHandlerStub) BroadcastOnChannelUsingPrivateKey(channel string, topic string, buff []byte, pid core.PeerID, skBytes []byte)
BroadcastOnChannelUsingPrivateKey -
func (*MessageHandlerStub) BroadcastUsingPrivateKey ¶
func (stub *MessageHandlerStub) BroadcastUsingPrivateKey(topic string, buff []byte, pid core.PeerID, skBytes []byte)
BroadcastUsingPrivateKey -
func (*MessageHandlerStub) CreateTopic ¶
func (stub *MessageHandlerStub) CreateTopic(name string, createChannelForTopic bool) error
CreateTopic -
func (*MessageHandlerStub) HasTopic ¶
func (stub *MessageHandlerStub) HasTopic(name string) bool
HasTopic -
func (*MessageHandlerStub) IsInterfaceNil ¶
func (stub *MessageHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*MessageHandlerStub) ProcessReceivedMessage ¶
func (stub *MessageHandlerStub) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID, source p2p.MessageHandler) error
ProcessReceivedMessage -
func (*MessageHandlerStub) RegisterMessageProcessor ¶
func (stub *MessageHandlerStub) RegisterMessageProcessor(topic string, identifier string, handler p2p.MessageProcessor) error
RegisterMessageProcessor -
func (*MessageHandlerStub) SendToConnectedPeer ¶
func (stub *MessageHandlerStub) SendToConnectedPeer(topic string, buff []byte, peerID core.PeerID) error
SendToConnectedPeer -
func (*MessageHandlerStub) SetDebugger ¶
func (stub *MessageHandlerStub) SetDebugger(debugger p2p.Debugger) error
SetDebugger -
func (*MessageHandlerStub) UnJoinAllTopics ¶
func (stub *MessageHandlerStub) UnJoinAllTopics() error
UnJoinAllTopics -
func (*MessageHandlerStub) UnregisterAllMessageProcessors ¶
func (stub *MessageHandlerStub) UnregisterAllMessageProcessors() error
UnregisterAllMessageProcessors -
func (*MessageHandlerStub) UnregisterMessageProcessor ¶
func (stub *MessageHandlerStub) UnregisterMessageProcessor(topic string, identifier string) error
UnregisterMessageProcessor -
type MessageProcessorMock ¶
type MessageProcessorMock struct {
// contains filtered or unexported fields
}
MessageProcessorMock -
func NewMessageProcessorMock ¶
func NewMessageProcessorMock() *MessageProcessorMock
NewMessageProcessorMock -
func (*MessageProcessorMock) GetMessages ¶
func (processor *MessageProcessorMock) GetMessages() map[core.PeerID]int
GetMessages -
func (*MessageProcessorMock) IsInterfaceNil ¶
func (processor *MessageProcessorMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*MessageProcessorMock) ProcessReceivedMessage ¶
func (processor *MessageProcessorMock) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID, _ p2p.MessageHandler) error
ProcessReceivedMessage -
type MessageProcessorStub ¶
type MessageProcessorStub struct {
ProcessMessageCalled func(message p2p.MessageP2P, fromConnectedPeer core.PeerID, source p2p.MessageHandler) 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, source p2p.MessageHandler) 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 ResourceManagerCalled func() network.ResourceManager }
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) SetStreamHandler ¶
func (ns *NetworkStub) SetStreamHandler(network.StreamHandler)
SetStreamHandler -
func (*NetworkStub) StopNotify ¶
func (ns *NetworkStub) StopNotify(notifee network.Notifiee)
StopNotify -
type P2PSignerStub ¶
type P2PSignerStub struct { SignCalled func(payload []byte) ([]byte, error) VerifyCalled func(payload []byte, pid core.PeerID, signature []byte) error SignUsingPrivateKeyCalled func(skBytes []byte, payload []byte) ([]byte, error) }
P2PSignerStub -
func (*P2PSignerStub) IsInterfaceNil ¶
func (stub *P2PSignerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*P2PSignerStub) SignUsingPrivateKey ¶
func (stub *P2PSignerStub) SignUsingPrivateKey(skBytes []byte, payload []byte) ([]byte, error)
SignUsingPrivateKey -
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 PeerTopicNotifierStub ¶
PeerTopicNotifierStub -
func (*PeerTopicNotifierStub) IsInterfaceNil ¶
func (stub *PeerTopicNotifierStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*PeerTopicNotifierStub) NewPeerFound ¶
func (stub *PeerTopicNotifierStub) NewPeerFound(pid core.PeerID, topic string)
NewPeerFound -
type PeersHolderStub ¶
type PeersHolderStub struct { PutConnectionAddressCalled func(peerID core.PeerID, address string) PutShardIDCalled func(peerID core.PeerID, shardID uint32) GetCalled func() map[uint32][]core.PeerID ContainsCalled func(peerID core.PeerID) bool RemoveCalled func(peerID core.PeerID) ClearCalled func() }
PeersHolderStub -
func (*PeersHolderStub) Contains ¶
func (p *PeersHolderStub) Contains(peerID core.PeerID) bool
Contains -
func (*PeersHolderStub) IsInterfaceNil ¶
func (p *PeersHolderStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*PeersHolderStub) PutConnectionAddress ¶
func (p *PeersHolderStub) PutConnectionAddress(peerID core.PeerID, address string)
PutConnectionAddress -
func (*PeersHolderStub) PutShardID ¶
func (p *PeersHolderStub) PutShardID(peerID core.PeerID, shardID uint32)
PutShardID -
type PeersOnChannelStub ¶
type PeersOnChannelStub struct { ConnectedPeersOnChannelCalled func(topic string) []core.PeerID CloseCalled func() error }
PeersOnChannelStub -
func (*PeersOnChannelStub) ConnectedPeersOnChannel ¶
func (stub *PeersOnChannelStub) ConnectedPeersOnChannel(topic string) []core.PeerID
ConnectedPeersOnChannel -
func (*PeersOnChannelStub) IsInterfaceNil ¶
func (stub *PeersOnChannelStub) IsInterfaceNil() bool
IsInterfaceNil -
type PeersRatingHandlerStub ¶
type PeersRatingHandlerStub struct { IncreaseRatingCalled func(pid core.PeerID) DecreaseRatingCalled func(pid core.PeerID) GetTopRatedPeersFromListCalled func(peers []core.PeerID, numOfPeers int) []core.PeerID }
PeersRatingHandlerStub -
func (*PeersRatingHandlerStub) DecreaseRating ¶
func (stub *PeersRatingHandlerStub) DecreaseRating(pid core.PeerID)
DecreaseRating -
func (*PeersRatingHandlerStub) GetTopRatedPeersFromList ¶
func (stub *PeersRatingHandlerStub) GetTopRatedPeersFromList(peers []core.PeerID, numOfPeers int) []core.PeerID
GetTopRatedPeersFromList -
func (*PeersRatingHandlerStub) IncreaseRating ¶
func (stub *PeersRatingHandlerStub) IncreaseRating(pid core.PeerID)
IncreaseRating -
func (*PeersRatingHandlerStub) IsInterfaceNil ¶
func (stub *PeersRatingHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
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, id2 ...protocol.ID) error SetProtocolsCalled func(id peer.ID, id2 ...protocol.ID) error RemoveProtocolsCalled func(id peer.ID, id2 ...protocol.ID) error SupportsProtocolsCalled func(id peer.ID, id2 ...protocol.ID) ([]protocol.ID, error) FirstSupportedProtocolCalled func(id peer.ID, id2 ...protocol.ID) (protocol.ID, error) PeerInfoCalled func(id peer.ID) peer.AddrInfo PeersCalled func() peer.IDSlice RemovePeerCalled func(id peer.ID) }
PeerstoreStub -
func (*PeerstoreStub) AddAddr ¶
func (ps *PeerstoreStub) AddAddr(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration)
AddAddr -
func (*PeerstoreStub) AddAddrs ¶
func (ps *PeerstoreStub) AddAddrs(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration)
AddAddrs -
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 ¶
func (ps *PeerstoreStub) AddrStream(ctx context.Context, id peer.ID) <-chan multiaddr.Multiaddr
AddrStream -
func (*PeerstoreStub) Addrs ¶
func (ps *PeerstoreStub) Addrs(p peer.ID) []multiaddr.Multiaddr
Addrs -
func (*PeerstoreStub) FirstSupportedProtocol ¶
func (ps *PeerstoreStub) FirstSupportedProtocol(id peer.ID, id2 ...protocol.ID) (protocol.ID, error)
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) SetAddr ¶
func (ps *PeerstoreStub) SetAddr(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration)
SetAddr -
func (*PeerstoreStub) SetAddrs ¶
func (ps *PeerstoreStub) SetAddrs(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration)
SetAddrs -
func (*PeerstoreStub) SetProtocols ¶
SetProtocols -
func (*PeerstoreStub) SupportsProtocols ¶
SupportsProtocols -
func (*PeerstoreStub) UpdateAddrs ¶
UpdateAddrs -
type PrivateKeyStub ¶
type PrivateKeyStub struct { ToByteArrayStub func() ([]byte, error) GeneratePublicStub func() crypto.PublicKey ScalarStub func() crypto.Scalar SuiteStub func() crypto.Suite }
PrivateKeyStub provides stubs for a PrivateKey implementation
func (*PrivateKeyStub) GeneratePublic ¶
func (privKey *PrivateKeyStub) GeneratePublic() crypto.PublicKey
GeneratePublic builds a public key for the current private key
func (*PrivateKeyStub) IsInterfaceNil ¶
func (privKey *PrivateKeyStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PrivateKeyStub) Scalar ¶
func (privKey *PrivateKeyStub) Scalar() crypto.Scalar
Scalar returns the Scalar corresponding to this Private Key
func (*PrivateKeyStub) Suite ¶
func (privKey *PrivateKeyStub) Suite() crypto.Suite
Suite returns the Suite (curve data) used for this private key
func (*PrivateKeyStub) ToByteArray ¶
func (privKey *PrivateKeyStub) ToByteArray() ([]byte, error)
ToByteArray returns the byte array representation of the private key
type PubSubStub ¶
type PubSubStub struct { JoinCalled func(topic string, opts ...pubsub.TopicOpt) (*pubsub.Topic, error) ListPeersCalled func(topic string) []peer.ID RegisterTopicValidatorCalled func(topic string, val interface{}, opts ...pubsub.ValidatorOpt) error UnregisterTopicValidatorCalled func(topic string) error GetTopicsCalled func() []string }
PubSubStub -
func (*PubSubStub) ListPeers ¶
func (stub *PubSubStub) ListPeers(topic string) []peer.ID
ListPeers -
func (*PubSubStub) RegisterTopicValidator ¶
func (stub *PubSubStub) RegisterTopicValidator(topic string, val interface{}, opts ...pubsub.ValidatorOpt) error
RegisterTopicValidator -
func (*PubSubStub) UnregisterTopicValidator ¶
func (stub *PubSubStub) UnregisterTopicValidator(topic string) error
UnregisterTopicValidator -
type PubSubSubscriptionStub ¶
type PubSubSubscriptionStub struct { TopicCalled func() string NextCalled func(ctx context.Context) (*pubsub.Message, error) CancelCalled func() }
PubSubSubscriptionStub -
type PubSubTopicStub ¶
type PubSubTopicStub struct { SubscribeCalled func(opts ...pubsub.SubOpt) (*pubsub.Subscription, error) PublishCalled func(ctx context.Context, data []byte, opts ...pubsub.PubOpt) error CloseCalled func() error }
PubSubTopicStub -
func (*PubSubTopicStub) Subscribe ¶
func (stub *PubSubTopicStub) Subscribe(opts ...pubsub.SubOpt) (*pubsub.Subscription, error)
Subscribe -
type PublicKeyStub ¶
type PublicKeyStub struct { ToByteArrayStub func() ([]byte, error) PointStub func() crypto.Point SuiteStub func() crypto.Suite }
PublicKeyStub provides stubs for a PublicKey implementation
func (*PublicKeyStub) IsInterfaceNil ¶
func (pubKey *PublicKeyStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PublicKeyStub) Point ¶
func (pubKey *PublicKeyStub) Point() crypto.Point
Point returns the Point corresponding to this Public Key
func (*PublicKeyStub) Suite ¶
func (pubKey *PublicKeyStub) Suite() crypto.Suite
Suite returns the Suite (curve data) used for this private key
func (*PublicKeyStub) ToByteArray ¶
func (pubKey *PublicKeyStub) ToByteArray() ([]byte, error)
ToByteArray returns the byte array representation of the public key
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) SetPeerShardResolver ¶
func (ss *SharderStub) SetPeerShardResolver(psp p2p.PeerShardResolver) error
SetPeerShardResolver -
type SingleSignerStub ¶
type SingleSignerStub struct { SignCalled func(private crypto.PrivateKey, msg []byte) ([]byte, error) VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error }
SingleSignerStub -
func (*SingleSignerStub) IsInterfaceNil ¶
func (s *SingleSignerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SingleSignerStub) Sign ¶
func (s *SingleSignerStub) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
Sign -
type SyncTimerStub ¶
SyncTimerStub -
func (*SyncTimerStub) IsInterfaceNil ¶
func (sts *SyncTimerStub) IsInterfaceNil() bool
IsInterfaceNil -
type ThrottlerStub ¶
type ThrottlerStub struct { CanProcessCalled func() bool StartProcessingCalled func() EndProcessingCalled func() }
ThrottlerStub -
func (*ThrottlerStub) IsInterfaceNil ¶
func (stub *ThrottlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ThrottlerStub) StartProcessing ¶
func (stub *ThrottlerStub) StartProcessing()
StartProcessing -
type TopicProcessorStub ¶
type TopicProcessorStub struct { AddTopicProcessorCalled func(identifier string, processor p2p.MessageProcessor) error RemoveTopicProcessorCalled func(identifier string) error GetListCalled func() ([]string, []p2p.MessageProcessor) }
TopicProcessorStub -
func (*TopicProcessorStub) AddTopicProcessor ¶
func (stub *TopicProcessorStub) AddTopicProcessor(identifier string, processor p2p.MessageProcessor) error
AddTopicProcessor -
func (*TopicProcessorStub) GetList ¶
func (stub *TopicProcessorStub) GetList() ([]string, []p2p.MessageProcessor)
GetList -
func (*TopicProcessorStub) IsInterfaceNil ¶
func (stub *TopicProcessorStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*TopicProcessorStub) RemoveTopicProcessor ¶
func (stub *TopicProcessorStub) RemoveTopicProcessor(identifier string) error
RemoveTopicProcessor -
Source Files ¶
- cacherStub.go
- channelLoadBalancerStub.go
- connStub.go
- connectableHostStub.go
- connectionMonitorStub.go
- connectionsMetricStub.go
- connectionsWatcherStub.go
- debuggerStub.go
- directSenderStub.go
- eventBusStub.go
- eventSubscriptionStub.go
- kadDhtHandlerStub.go
- kadSharderStub.go
- keyMock.go
- keyStub.go
- messageHandlerStub.go
- messageProcessorMock.go
- messageProcessorStub.go
- multiaddrStub.go
- networkShardingCollectorMock.go
- networkStub.go
- p2pSignerStub.go
- peerDenialEvaluatorStub.go
- peerDiscovererStub.go
- peerShardResolverStub.go
- peerTopicNotifierStub.go
- peersHolderStub.go
- peersOnChannelStub.go
- peersRatingHandlerStub.go
- peerstoreStub.go
- pubSubStub.go
- pubSubSubscriptionStub.go
- pubSubTopicStub.go
- reconnecterStub.go
- sharderStub.go
- singleSignerStub.go
- streamMock.go
- syncTimerStub.go
- throttlerStub.go
- topicProcessorStub.go