Documentation ¶
Index ¶
- func NewStreamMock() *streamMock
- type ChannelLoadBalancerStub
- func (plbs *ChannelLoadBalancerStub) AddChannel(pipe string) error
- func (plbs *ChannelLoadBalancerStub) CollectOneElementFromChannels() *p2p.SendableData
- func (plbs *ChannelLoadBalancerStub) GetChannelOrDefault(pipe string) chan *p2p.SendableData
- func (plbs *ChannelLoadBalancerStub) IsInterfaceNil() bool
- func (plbs *ChannelLoadBalancerStub) RemoveChannel(pipe string) error
- type ConnManagerNotifieeStub
- 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
- func (cs *ConnStub) Close() error
- func (cs *ConnStub) GetStreams() []network.Stream
- func (cs *ConnStub) LocalMultiaddr() multiaddr.Multiaddr
- func (cs *ConnStub) LocalPeer() peer.ID
- func (cs *ConnStub) LocalPrivateKey() libp2pCrypto.PrivKey
- func (cs *ConnStub) NewStream() (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
- 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 ContextProviderMock
- type MessageProcessorStub
- type MockMessageProcessor
- 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(ctx context.Context, pid 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(network.Notifiee)
- type PeerDiscovererStub
- type ReconnecterStub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStreamMock ¶
func NewStreamMock() *streamMock
Types ¶
type ChannelLoadBalancerStub ¶
type ChannelLoadBalancerStub struct { AddChannelCalled func(pipe string) error RemoveChannelCalled func(pipe string) error GetChannelOrDefaultCalled func(pipe string) chan *p2p.SendableData CollectOneElementFromChannelsCalled func() *p2p.SendableData }
func (*ChannelLoadBalancerStub) AddChannel ¶
func (plbs *ChannelLoadBalancerStub) AddChannel(pipe string) error
func (*ChannelLoadBalancerStub) CollectOneElementFromChannels ¶
func (plbs *ChannelLoadBalancerStub) CollectOneElementFromChannels() *p2p.SendableData
func (*ChannelLoadBalancerStub) GetChannelOrDefault ¶
func (plbs *ChannelLoadBalancerStub) GetChannelOrDefault(pipe string) chan *p2p.SendableData
func (*ChannelLoadBalancerStub) IsInterfaceNil ¶
func (plbs *ChannelLoadBalancerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ChannelLoadBalancerStub) RemoveChannel ¶
func (plbs *ChannelLoadBalancerStub) RemoveChannel(pipe string) error
type ConnManagerNotifieeStub ¶
type ConnManagerNotifieeStub struct { UpsertTagCalled func(p peer.ID, tag string, upsert func(int) int) ProtectCalled func(id peer.ID, tag string) UnprotectCalled func(id peer.ID, tag string) (protected bool) CloseCalled func() error TagPeerCalled func(p peer.ID, tag string, val int) UntagPeerCalled func(p peer.ID, tag string) GetTagInfoCalled func(p peer.ID) *connmgr.TagInfo TrimOpenConnsCalled func(ctx context.Context) ListenCalled func(netw network.Network, ma multiaddr.Multiaddr) ListenCloseCalled func(netw network.Network, ma multiaddr.Multiaddr) ConnectedCalled func(netw network.Network, conn network.Conn) DisconnectedCalled func(netw network.Network, conn network.Conn) OpenedStreamCalled func(netw network.Network, stream network.Stream) ClosedStreamCalled func(netw network.Network, stream network.Stream) }
func (*ConnManagerNotifieeStub) Close ¶
func (cmns *ConnManagerNotifieeStub) Close() error
func (*ConnManagerNotifieeStub) ClosedStream ¶
func (cmns *ConnManagerNotifieeStub) ClosedStream(netw network.Network, stream network.Stream)
func (*ConnManagerNotifieeStub) Connected ¶
func (cmns *ConnManagerNotifieeStub) Connected(netw network.Network, conn network.Conn)
func (*ConnManagerNotifieeStub) Disconnected ¶
func (cmns *ConnManagerNotifieeStub) Disconnected(netw network.Network, conn network.Conn)
func (*ConnManagerNotifieeStub) GetTagInfo ¶
func (cmns *ConnManagerNotifieeStub) GetTagInfo(p peer.ID) *connmgr.TagInfo
func (*ConnManagerNotifieeStub) Listen ¶
func (cmns *ConnManagerNotifieeStub) Listen(netw network.Network, ma multiaddr.Multiaddr)
func (*ConnManagerNotifieeStub) ListenClose ¶
func (cmns *ConnManagerNotifieeStub) ListenClose(netw network.Network, ma multiaddr.Multiaddr)
func (*ConnManagerNotifieeStub) Notifee ¶
func (cmns *ConnManagerNotifieeStub) Notifee() network.Notifiee
func (*ConnManagerNotifieeStub) OpenedStream ¶
func (cmns *ConnManagerNotifieeStub) OpenedStream(netw network.Network, stream network.Stream)
func (*ConnManagerNotifieeStub) Protect ¶
func (cmns *ConnManagerNotifieeStub) Protect(id peer.ID, tag string)
func (*ConnManagerNotifieeStub) TagPeer ¶
func (cmns *ConnManagerNotifieeStub) TagPeer(p peer.ID, tag string, val int)
func (*ConnManagerNotifieeStub) TrimOpenConns ¶
func (cmns *ConnManagerNotifieeStub) TrimOpenConns(ctx context.Context)
func (*ConnManagerNotifieeStub) Unprotect ¶
func (cmns *ConnManagerNotifieeStub) Unprotect(id peer.ID, tag string) (protected bool)
type ConnStub ¶
type ConnStub struct { 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() (network.Stream, error) GetStreamsCalled func() []network.Stream StatCalled func() network.Stat }
func (*ConnStub) GetStreams ¶
func (*ConnStub) LocalMultiaddr ¶
func (cs *ConnStub) LocalMultiaddr() multiaddr.Multiaddr
func (*ConnStub) LocalPrivateKey ¶
func (cs *ConnStub) LocalPrivateKey() libp2pCrypto.PrivKey
func (*ConnStub) RemoteMultiaddr ¶
func (cs *ConnStub) RemoteMultiaddr() multiaddr.Multiaddr
func (*ConnStub) RemotePeer ¶
func (*ConnStub) RemotePublicKey ¶
func (cs *ConnStub) RemotePublicKey() libp2pCrypto.PubKey
type ConnectableHostStub ¶
type ConnectableHostStub struct { EventBusCalled func() event.Bus IDCalled func() peer.ID PeerstoreCalled func() peerstore.Peerstore AddrsCalled func() []multiaddr.Multiaddr NetworkCalled func() network.Network MuxCalled func() protocol.Switch ConnectCalled func(ctx context.Context, pi peer.AddrInfo) error SetStreamHandlerCalled func(pid protocol.ID, handler network.StreamHandler) SetStreamHandlerMatchCalled func(protocol.ID, func(string) bool, network.StreamHandler) RemoveStreamHandlerCalled func(pid protocol.ID) NewStreamCalled func(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error) CloseCalled func() error ConnManagerCalled func() connmgr.ConnManager ConnectToPeerCalled func(ctx context.Context, address string) error }
func (*ConnectableHostStub) Addrs ¶
func (hs *ConnectableHostStub) Addrs() []multiaddr.Multiaddr
func (*ConnectableHostStub) Close ¶
func (hs *ConnectableHostStub) Close() error
func (*ConnectableHostStub) ConnManager ¶
func (hs *ConnectableHostStub) ConnManager() connmgr.ConnManager
func (*ConnectableHostStub) ConnectToPeer ¶
func (hs *ConnectableHostStub) ConnectToPeer(ctx context.Context, address string) error
func (*ConnectableHostStub) EventBus ¶
func (hs *ConnectableHostStub) EventBus() event.Bus
func (*ConnectableHostStub) ID ¶
func (hs *ConnectableHostStub) ID() peer.ID
func (*ConnectableHostStub) IsInterfaceNil ¶
func (hs *ConnectableHostStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ConnectableHostStub) Mux ¶
func (hs *ConnectableHostStub) Mux() protocol.Switch
func (*ConnectableHostStub) Network ¶
func (hs *ConnectableHostStub) Network() network.Network
func (*ConnectableHostStub) Peerstore ¶
func (hs *ConnectableHostStub) Peerstore() peerstore.Peerstore
func (*ConnectableHostStub) RemoveStreamHandler ¶
func (hs *ConnectableHostStub) RemoveStreamHandler(pid protocol.ID)
func (*ConnectableHostStub) SetStreamHandler ¶
func (hs *ConnectableHostStub) SetStreamHandler(pid protocol.ID, handler network.StreamHandler)
func (*ConnectableHostStub) SetStreamHandlerMatch ¶
func (hs *ConnectableHostStub) SetStreamHandlerMatch(pid protocol.ID, handler func(string) bool, streamHandler network.StreamHandler)
type ContextProviderMock ¶
type ContextProviderMock struct { }
func (*ContextProviderMock) Context ¶
func (*ContextProviderMock) Context() context.Context
func (*ContextProviderMock) IsInterfaceNil ¶
func (c *ContextProviderMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type MessageProcessorStub ¶
type MessageProcessorStub struct {
ProcessMessageCalled func(message p2p.MessageP2P, broadcastHandler func(buffToSend []byte)) error
}
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, broadcastHandler func(buffToSend []byte)) error
type MockMessageProcessor ¶ added in v1.0.12
func NewMockMessageProcessor ¶ added in v1.0.12
func NewMockMessageProcessor(peer p2p.PeerID) *MockMessageProcessor
func (*MockMessageProcessor) IsInterfaceNil ¶ added in v1.0.16
func (processor *MockMessageProcessor) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MockMessageProcessor) ProcessReceivedMessage ¶ added in v1.0.12
func (processor *MockMessageProcessor) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
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) PeersCall func() []peer.ID ClosePeerCall func(peer.ID) error }
func (*NetworkStub) Close ¶
func (ns *NetworkStub) Close() error
func (*NetworkStub) Connectedness ¶
func (ns *NetworkStub) Connectedness(pid peer.ID) network.Connectedness
func (*NetworkStub) Conns ¶
func (ns *NetworkStub) Conns() []network.Conn
func (*NetworkStub) ConnsToPeer ¶
func (ns *NetworkStub) ConnsToPeer(p peer.ID) []network.Conn
func (*NetworkStub) InterfaceListenAddresses ¶
func (ns *NetworkStub) InterfaceListenAddresses() ([]multiaddr.Multiaddr, error)
func (*NetworkStub) Listen ¶
func (ns *NetworkStub) Listen(...multiaddr.Multiaddr) error
func (*NetworkStub) ListenAddresses ¶
func (ns *NetworkStub) ListenAddresses() []multiaddr.Multiaddr
func (*NetworkStub) LocalPeer ¶
func (ns *NetworkStub) LocalPeer() peer.ID
func (*NetworkStub) Notify ¶
func (ns *NetworkStub) Notify(notifee network.Notifiee)
func (*NetworkStub) Peers ¶
func (ns *NetworkStub) Peers() []peer.ID
func (*NetworkStub) Peerstore ¶
func (ns *NetworkStub) Peerstore() peerstore.Peerstore
func (*NetworkStub) Process ¶
func (ns *NetworkStub) Process() goprocess.Process
func (*NetworkStub) SetConnHandler ¶
func (ns *NetworkStub) SetConnHandler(network.ConnHandler)
func (*NetworkStub) SetStreamHandler ¶
func (ns *NetworkStub) SetStreamHandler(network.StreamHandler)
func (*NetworkStub) StopNotify ¶
func (ns *NetworkStub) StopNotify(network.Notifiee)
type PeerDiscovererStub ¶
type PeerDiscovererStub struct { BootstrapCalled func() error CloseCalled func() error ApplyContextCalled func(ctxProvider p2p.ContextProvider) error }
func (*PeerDiscovererStub) ApplyContext ¶ added in v1.0.3
func (pds *PeerDiscovererStub) ApplyContext(ctxProvider p2p.ContextProvider) error
func (*PeerDiscovererStub) Bootstrap ¶
func (pds *PeerDiscovererStub) Bootstrap() error
func (*PeerDiscovererStub) IsInterfaceNil ¶
func (pds *PeerDiscovererStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PeerDiscovererStub) Name ¶
func (pds *PeerDiscovererStub) Name() string
type ReconnecterStub ¶
type ReconnecterStub struct { ReconnectToNetworkCalled func() <-chan struct{} PauseCall func() ResumeCall func() }
func (*ReconnecterStub) IsInterfaceNil ¶
func (rs *ReconnecterStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ReconnecterStub) Pause ¶ added in v1.0.37
func (rs *ReconnecterStub) Pause()
func (*ReconnecterStub) ReconnectToNetwork ¶
func (rs *ReconnecterStub) ReconnectToNetwork() <-chan struct{}
func (*ReconnecterStub) Resume ¶ added in v1.0.37
func (rs *ReconnecterStub) Resume()
Click to show internal directories.
Click to hide internal directories.