Versions in this module Expand all Collapse all v1 v1.1.66 Jun 17, 2021 v1.1.65 Jun 17, 2021 Changes in this version + func NewStreamMock() *streamMock + type AppStatusHandlerMock struct + func NewAppStatusHandlerMock() *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 struct + AddChannelCalled func(pipe string) error + CloseCalled func() error + CollectOneElementFromChannelsCalled func() *p2p.SendableData + GetChannelOrDefaultCalled func(pipe string) chan *p2p.SendableData + RemoveChannelCalled func(pipe string) error + 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 struct + SetPeerShardResolverCalled func(psp p2p.PeerShardResolver) error + func (cs *CommonSharder) IsInterfaceNil() bool + func (cs *CommonSharder) SetPeerShardResolver(psp p2p.PeerShardResolver) error + type ConnManagerNotifieeStub struct + CloseCalled func() error + ClosedStreamCalled func(netw network.Network, stream network.Stream) + ConnectedCalled func(netw network.Network, conn network.Conn) + DisconnectedCalled func(netw network.Network, conn network.Conn) + GetTagInfoCalled func(p peer.ID) *connmgr.TagInfo + ListenCalled func(netw network.Network, ma multiaddr.Multiaddr) + ListenCloseCalled func(netw network.Network, ma multiaddr.Multiaddr) + OpenedStreamCalled func(netw network.Network, stream network.Stream) + ProtectCalled func(id peer.ID, tag string) + TagPeerCalled func(p peer.ID, tag string, val int) + TrimOpenConnsCalled func(ctx context.Context) + UnprotectCalled func(id peer.ID, tag string) (protected bool) + UntagPeerCalled func(p peer.ID, tag string) + UpsertTagCalled func(p peer.ID, tag string, upsert func(int) int) + func (cmns *ConnManagerNotifieeStub) Close() error + func (cmns *ConnManagerNotifieeStub) ClosedStream(netw network.Network, stream network.Stream) + 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) OpenedStream(netw network.Network, stream network.Stream) + 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 struct + CloseCalled func() error + GetStreamsCalled func() []network.Stream + IDCalled func() string + LocalMultiaddrCalled func() multiaddr.Multiaddr + LocalPeerCalled func() peer.ID + LocalPrivateKeyCalled func() libp2pCrypto.PrivKey + NewStreamCalled func(ctx context.Context) (network.Stream, error) + RemoteMultiaddrCalled func() multiaddr.Multiaddr + RemotePeerCalled func() peer.ID + RemotePublicKeyCalled func() libp2pCrypto.PubKey + StatCalled func() network.Stat + func (cs *ConnStub) Close() error + func (cs *ConnStub) GetStreams() []network.Stream + func (cs *ConnStub) ID() string + 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) Stat() network.Stat + type ConnectableHostStub struct + AddrsCalled func() []multiaddr.Multiaddr + CloseCalled func() error + ConnManagerCalled func() connmgr.ConnManager + ConnectCalled func(ctx context.Context, pi peer.AddrInfo) error + ConnectToPeerCalled func(ctx context.Context, address string) error + EventBusCalled func() event.Bus + IDCalled func() peer.ID + MuxCalled func() protocol.Switch + NetworkCalled func() network.Network + NewStreamCalled func(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error) + PeerstoreCalled func() peerstore.Peerstore + RemoveStreamHandlerCalled func(pid protocol.ID) + SetStreamHandlerCalled func(pid protocol.ID, handler network.StreamHandler) + SetStreamHandlerMatchCalled func(protocol.ID, func(string) bool, network.StreamHandler) + 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(string) bool, ...) + type ConnectionMonitorStub struct + ClosedStreamCalled func(netw network.Network, stream network.Stream) + ConnectedCalled func(netw network.Network, conn network.Conn) + DisconnectedCalled func(netw network.Network, conn network.Conn) + IsConnectedToTheNetworkCalled func(netw network.Network) bool + ListenCalled func(netw network.Network, ma multiaddr.Multiaddr) + ListenCloseCalled func(netw network.Network, ma multiaddr.Multiaddr) + OpenedStreamCalled func(netw network.Network, stream network.Stream) + SetThresholdMinConnectedPeersCalled func(thresholdMinConnectedPeers int, netw network.Network) + ThresholdMinConnectedPeersCalled func() int + func (cms *ConnectionMonitorStub) ClosedStream(netw network.Network, stream network.Stream) + 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) OpenedStream(netw network.Network, stream network.Stream) + func (cms *ConnectionMonitorStub) SetThresholdMinConnectedPeers(thresholdMinConnectedPeers int, netw network.Network) + func (cms *ConnectionMonitorStub) ThresholdMinConnectedPeers() int + type ContextProviderMock struct + func (*ContextProviderMock) Context() context.Context + func (c *ContextProviderMock) IsInterfaceNil() bool + type EventBusStub struct + EmitterCalled func(eventType interface{}, opts ...event.EmitterOpt) (event.Emitter, error) + GetAllEventTypesCalled func() []reflect.Type + SubscribeCalled func(eventType interface{}, opts ...event.SubscriptionOpt) (event.Subscription, error) + func (ebs *EventBusStub) Emitter(eventType interface{}, opts ...event.EmitterOpt) (event.Emitter, error) + func (ebs *EventBusStub) GetAllEventTypes() []reflect.Type + func (ebs *EventBusStub) Subscribe(eventType interface{}, opts ...event.SubscriptionOpt) (event.Subscription, error) + type EventSubscriptionStub struct + CloseCalled func() error + OutCalled func() <-chan interface{} + func (ess *EventSubscriptionStub) Close() error + func (ess *EventSubscriptionStub) Out() <-chan interface{} + type MarshalizerStub struct + MarshalCalled func(obj interface{}) ([]byte, error) + UnmarshalCalled func(obj interface{}, buff []byte) error + func (ms *MarshalizerStub) IsInterfaceNil() bool + func (ms *MarshalizerStub) Marshal(obj interface{}) ([]byte, error) + func (ms *MarshalizerStub) Unmarshal(obj interface{}, buff []byte) error + type MessageProcessorStub struct + ProcessMessageCalled func(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error + func (mps *MessageProcessorStub) IsInterfaceNil() bool + func (mps *MessageProcessorStub) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error + type MultiaddrStub struct + BytesCalled func() []byte + DecapsulateCalled func(multiaddr multiaddr.Multiaddr) multiaddr.Multiaddr + EncapsulateCalled func(multiaddr multiaddr.Multiaddr) multiaddr.Multiaddr + EqualCalled func(multiaddr multiaddr.Multiaddr) bool + MarshalBinaryCalled func() (data []byte, err error) + MarshalJSONCalled func() ([]byte, error) + MarshalTextCalled func() (text []byte, err error) + ProtocolsCalled func() []multiaddr.Protocol + StringCalled func() string + UnmarshalBinaryCalled func(data []byte) error + UnmarshalJSONCalled func(bytes []byte) error + UnmarshalTextCalled func(text []byte) error + ValueForProtocolCalled func(code int) (string, error) + 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 NetworkShardingCollectorStub struct + UpdatePeerIdPublicKeyCalled func(pid core.PeerID, pk []byte) + func (nscs *NetworkShardingCollectorStub) IsInterfaceNil() bool + func (nscs *NetworkShardingCollectorStub) UpdatePeerIdPublicKey(pid core.PeerID, pk []byte) + type NetworkStub struct + ClosePeerCall func(peer.ID) error + ConnectednessCalled func(peer.ID) network.Connectedness + ConnsCalled func() []network.Conn + ConnsToPeerCalled func(p peer.ID) []network.Conn + NotifyCalled func(network.Notifiee) + PeersCall func() []peer.ID + StopNotifyCalled func(network.Notifiee) + 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) SetConnHandler(network.ConnHandler) + func (ns *NetworkStub) SetStreamHandler(network.StreamHandler) + func (ns *NetworkStub) StopNotify(notifee network.Notifiee) + type P2PMessageMock struct + DataField []byte + FromField []byte + KeyField []byte + PayloadField []byte + PeerField core.PeerID + SeqNoField []byte + SignatureField []byte + TimestampField int64 + TopicField string + 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) Topic() string + type PeerDenialEvaluatorStub struct + IsDeniedCalled func(pid core.PeerID) bool + UpsertPeerIDCalled func(pid core.PeerID, duration time.Duration) error + func (pdes *PeerDenialEvaluatorStub) IsDenied(pid core.PeerID) bool + func (pdes *PeerDenialEvaluatorStub) IsInterfaceNil() bool + func (pdes *PeerDenialEvaluatorStub) UpsertPeerID(pid core.PeerID, duration time.Duration) error + type PeerDiscovererStub struct + BootstrapCalled func() error + CloseCalled func() error + func (pds *PeerDiscovererStub) Bootstrap() error + func (pds *PeerDiscovererStub) IsInterfaceNil() bool + func (pds *PeerDiscovererStub) Name() string + type PeerShardResolverStub struct + GetPeerInfoCalled func(pid core.PeerID) core.P2PPeerInfo + func (psrs *PeerShardResolverStub) GetPeerInfo(pid core.PeerID) core.P2PPeerInfo + func (psrs *PeerShardResolverStub) IsInterfaceNil() bool + type PeerstoreStub struct + AddAddrCalled func(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration) + AddAddrsCalled func(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration) + AddPrivKeyCalled func(id peer.ID, key libp2pCrypto.PrivKey) error + AddProtocolsCalled func(id peer.ID, s ...string) error + AddPubKeyCalled func(id peer.ID, key libp2pCrypto.PubKey) error + AddrStreamCalled func(ctx context.Context, id peer.ID) <-chan multiaddr.Multiaddr + AddrsCalled func(p peer.ID) []multiaddr.Multiaddr + ClearAddrsCalled func(p peer.ID) + CloseCalled func() error + FirstSupportedProtocolCalled func(id peer.ID, s ...string) (string, error) + GetCalled func(p peer.ID, key string) (interface{}, error) + GetProtocolsCalled func(id peer.ID) ([]string, error) + LatencyEWMACalled func(id peer.ID) time.Duration + PeerInfoCalled func(id peer.ID) peer.AddrInfo + PeersCalled func() peer.IDSlice + PeersWithAddrsCalled func() peer.IDSlice + PeersWithKeysCalled func() peer.IDSlice + PrivKeyCalled func(id peer.ID) libp2pCrypto.PrivKey + PubKeyCalled func(id peer.ID) libp2pCrypto.PubKey + PutCalled func(p peer.ID, key string, val interface{}) error + RecordLatencyCalled func(id peer.ID, duration time.Duration) + RemoveProtocolsCalled func(id peer.ID, s ...string) error + SetAddrCalled func(p peer.ID, addr multiaddr.Multiaddr, ttl time.Duration) + SetAddrsCalled func(p peer.ID, addrs []multiaddr.Multiaddr, ttl time.Duration) + SetProtocolsCalled func(id peer.ID, s ...string) error + SupportsProtocolsCalled func(id peer.ID, s ...string) ([]string, error) + UpdateAddrsCalled func(p peer.ID, oldTTL time.Duration, newTTL time.Duration) + 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 ...string) 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 ...string) (string, error) + func (ps *PeerstoreStub) Get(p peer.ID, key string) (interface{}, error) + func (ps *PeerstoreStub) GetProtocols(id peer.ID) ([]string, 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) RemoveProtocols(id peer.ID, s ...string) 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 ...string) error + func (ps *PeerstoreStub) SupportsProtocols(id peer.ID, s ...string) ([]string, error) + func (ps *PeerstoreStub) UpdateAddrs(p peer.ID, oldTTL time.Duration, newTTL time.Duration) + type ReconnecterStub struct + PauseCall func() + ReconnectToNetworkCalled func() <-chan struct{} + ResumeCall func() + func (rs *ReconnecterStub) IsInterfaceNil() bool + func (rs *ReconnecterStub) ReconnectToNetwork() <-chan struct{} + 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 + func (ss *SharderStub) ComputeEvictionList(pidList []peer.ID) []peer.ID + func (ss *SharderStub) Has(pid peer.ID, list []peer.ID) bool + func (ss *SharderStub) IsInterfaceNil() bool + func (ss *SharderStub) SetPeerShardResolver(psp p2p.PeerShardResolver) error + type SignerVerifierStub struct + PublicKeyCalled func() []byte + SignCalled func(message []byte) ([]byte, error) + VerifyCalled func(message []byte, sig []byte, pk []byte) error + func (svs *SignerVerifierStub) IsInterfaceNil() bool + func (svs *SignerVerifierStub) PublicKey() []byte + func (svs *SignerVerifierStub) Sign(message []byte) ([]byte, error) + func (svs *SignerVerifierStub) Verify(message []byte, sig []byte, pk []byte) error + type SyncTimerStub struct + CurrentTimeCalled func() time.Time + func (sts *SyncTimerStub) CurrentTime() time.Time + func (sts *SyncTimerStub) IsInterfaceNil() bool