Versions in this module Expand all Collapse all v1 v1.0.1 Apr 21, 2023 Changes in this version + type MockDiscoveryClient struct + func (mdc *MockDiscoveryClient) FindPeers(ctx context.Context, in *proto.FindPeersReq, opts ...grpc.CallOption) (*proto.FindPeersResp, error) + func (mdc *MockDiscoveryClient) HookFindPeers(fn findPeersDelegate) + type MockIdentityClient struct + func (mic *MockIdentityClient) Hello(ctx context.Context, in *proto.Status, opts ...grpc.CallOption) (*proto.Status, error) + func (mic *MockIdentityClient) HookHello(fn helloDelegate) + type MockNetworkingServer struct + func NewMockNetworkingServer() *MockNetworkingServer + func (m *MockNetworkingServer) AddPeer(id peer.ID, direction network.Direction) + func (m *MockNetworkingServer) AddToPeerStore(peerInfo *peer.AddrInfo) + func (m *MockNetworkingServer) CloseProtocolStream(protocol string, peerID peer.ID) error + func (m *MockNetworkingServer) DisconnectFromPeer(peerID peer.ID, reason string) + func (m *MockNetworkingServer) EmitEvent(event *event.PeerEvent) + func (m *MockNetworkingServer) FetchOrSetTemporaryDial(peerID peer.ID, newValue bool) bool + func (m *MockNetworkingServer) GetBootnodeConnCount() int64 + func (m *MockNetworkingServer) GetMockDiscoveryClient() *MockDiscoveryClient + func (m *MockNetworkingServer) GetMockIdentityClient() *MockIdentityClient + func (m *MockNetworkingServer) GetMockPeerMetrics() *MockPeerMetrics + func (m *MockNetworkingServer) GetPeerInfo(peerID peer.ID) *peer.AddrInfo + func (m *MockNetworkingServer) GetRandomBootnode() *peer.AddrInfo + func (m *MockNetworkingServer) GetRandomPeer() *peer.ID + func (m *MockNetworkingServer) HasFreeConnectionSlot(direction network.Direction) bool + func (m *MockNetworkingServer) HookAddPeer(fn addPeerDelegate) + func (m *MockNetworkingServer) HookAddToPeerStore(fn addToPeerStoreDelegate) + func (m *MockNetworkingServer) HookCloseProtocolStream(fn closeProtocolStreamDelegate) + func (m *MockNetworkingServer) HookDisconnectFromPeer(fn disconnectFromPeerDelegate) + func (m *MockNetworkingServer) HookEmitEvent(fn emitEventDelegate) + func (m *MockNetworkingServer) HookFetchAndSetTemporaryDial(fn fetchAndSetTemporaryDialDelegate) + func (m *MockNetworkingServer) HookGetBootnodeConnCount(fn getBootnodeConnCountDelegate) + func (m *MockNetworkingServer) HookGetPeerInfo(fn getPeerInfoDelegate) + func (m *MockNetworkingServer) HookGetRandomBootnode(fn getRandomBootnodeDelegate) + func (m *MockNetworkingServer) HookGetRandomPeer(fn getRandomPeerDelegate) + func (m *MockNetworkingServer) HookHasFreeConnectionSlot(fn hasFreeConnectionSlotDelegate) + func (m *MockNetworkingServer) HookIsTemporaryDial(fn isTemporaryDialDelegate) + func (m *MockNetworkingServer) HookNewDiscoveryClient(fn newDiscoveryClientDelegate) + func (m *MockNetworkingServer) HookNewIdentityClient(fn newIdentityClientDelegate) + func (m *MockNetworkingServer) HookRemoveFromPeerStore(fn removeFromPeerStoreDelegate) + func (m *MockNetworkingServer) HookRemoveTemporaryDial(fn removeTemporaryDialDelegate) + func (m *MockNetworkingServer) HookTemporaryDialPeer(fn temporaryDialPeerDelegate) + func (m *MockNetworkingServer) HookUpdatePendingConnCount(fn updatePendingConnCountDelegate) + func (m *MockNetworkingServer) IsTemporaryDial(peerID peer.ID) bool + func (m *MockNetworkingServer) NewDiscoveryClient(peerID peer.ID) (proto.DiscoveryClient, error) + func (m *MockNetworkingServer) NewIdentityClient(peerID peer.ID) (proto.IdentityClient, error) + func (m *MockNetworkingServer) RemoveFromPeerStore(peerInfo *peer.AddrInfo) + func (m *MockNetworkingServer) RemoveTemporaryDial(peerID peer.ID) + func (m *MockNetworkingServer) TemporaryDialPeer(peerAddrInfo *peer.AddrInfo) + func (m *MockNetworkingServer) UpdatePendingConnCount(delta int64, direction network.Direction) + type MockPeerMetrics struct + func (m *MockPeerMetrics) HookLatencyEWMA(fn latencyEWMADelegate) + func (m *MockPeerMetrics) HookRecordLatency(fn recordLatencyDelegate) + func (m *MockPeerMetrics) HookRemoveMetricsPeer(fn removeMetricsPeerDelegate) + func (m *MockPeerMetrics) LatencyEWMA(id peer.ID) time.Duration + func (m *MockPeerMetrics) RecordLatency(id peer.ID, duration time.Duration) + func (m *MockPeerMetrics) RemovePeer(id peer.ID)