Documentation ¶
Index ¶
- type MockDiscoveryClient
- func (mdc *MockDiscoveryClient) Close() error
- func (mdc *MockDiscoveryClient) FindPeers(ctx context.Context, in *proto.FindPeersReq) (*proto.FindPeersResp, error)
- func (mdc *MockDiscoveryClient) HookClose(fn closeDelegate)
- func (mdc *MockDiscoveryClient) HookFindPeers(fn findPeersDelegate)
- func (mdc *MockDiscoveryClient) HookIsClose(fn isCloseDelegate)
- func (mdc *MockDiscoveryClient) IsClose() bool
- type MockIdentityClient
- func (mic *MockIdentityClient) Close() error
- func (mic *MockIdentityClient) Hello(ctx context.Context, in *proto.Status) (*proto.Status, error)
- func (mic *MockIdentityClient) HookClose(fn closeDelegate)
- func (mic *MockIdentityClient) HookHello(fn helloDelegate)
- func (mic *MockIdentityClient) HookIsClose(fn isCloseDelegate)
- func (mic *MockIdentityClient) IsClose() bool
- type MockNetworkingServer
- func (m *MockNetworkingServer) AddPeer(id peer.ID, direction network.Direction)
- func (m *MockNetworkingServer) AddToPeerStore(peerInfo *peer.AddrInfo)
- func (m *MockNetworkingServer) Connect(addrInfo peer.AddrInfo) error
- func (m *MockNetworkingServer) DisconnectFromPeer(peerID peer.ID, reason string)
- func (m *MockNetworkingServer) EmitEvent(ctx context.Context, event *event.PeerEvent)
- 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) GetTracer() telemetry.Tracer
- func (m *MockNetworkingServer) HasFreeConnectionSlot(direction network.Direction) bool
- func (m *MockNetworkingServer) HasPeer(peerID peer.ID) bool
- func (m *MockNetworkingServer) HookAddPeer(fn addPeerDelegate)
- func (m *MockNetworkingServer) HookAddToPeerStore(fn addToPeerStoreDelegate)
- func (m *MockNetworkingServer) HookConnect(fn connectDelegate)
- func (m *MockNetworkingServer) HookDisconnectFromPeer(fn disconnectFromPeerDelegate)
- func (m *MockNetworkingServer) HookEmitEvent(fn emitEventDelegate)
- func (m *MockNetworkingServer) HookGetPeerInfo(fn getPeerInfoDelegate)
- func (m *MockNetworkingServer) HookGetRandomBootnode(fn getRandomBootnodeDelegate)
- func (m *MockNetworkingServer) HookGetRandomPeer(fn getRandomPeerDelegate)
- func (m *MockNetworkingServer) HookGetTracer(fn getTraceDelegate)
- func (m *MockNetworkingServer) HookHasFreeConnectionSlot(fn hasFreeConnectionSlotDelegate)
- func (m *MockNetworkingServer) HookHasPeer(fn hasPeerDelegate)
- func (m *MockNetworkingServer) HookIsBootnode(fn isBootnodeDelegate)
- func (m *MockNetworkingServer) HookIsStaticPeer(fn isStaticPeerDelegate)
- func (m *MockNetworkingServer) HookNewDiscoveryClient(fn newDiscoveryClientDelegate)
- func (m *MockNetworkingServer) HookNewIdentityClient(fn newIdentityClientDelegate)
- func (m *MockNetworkingServer) HookPeerCount(fn peerCountDelegate)
- func (m *MockNetworkingServer) HookRemoveFromPeerStore(fn removeFromPeerStoreDelegate)
- func (m *MockNetworkingServer) HookUpdatePendingConnCount(fn updatePendingConnCountDelegate)
- func (m *MockNetworkingServer) IsBootnode(peerID peer.ID) bool
- func (m *MockNetworkingServer) IsStaticPeer(peerID peer.ID) bool
- func (m *MockNetworkingServer) NewDiscoveryClient(ctx context.Context, peerID peer.ID) (client.DiscoveryClient, error)
- func (m *MockNetworkingServer) NewIdentityClient(ctx context.Context, peerID peer.ID) (client.IdentityClient, error)
- func (m *MockNetworkingServer) PeerCount() int64
- func (m *MockNetworkingServer) RemoveFromPeerStore(peerID peer.ID)
- func (m *MockNetworkingServer) UpdatePendingConnCount(delta int64, direction network.Direction)
- type MockPeerMetrics
- 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)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockDiscoveryClient ¶
type MockDiscoveryClient struct {
// contains filtered or unexported fields
}
MockDiscoveryClient mocks a discovery client (other peer in the communication)
func (*MockDiscoveryClient) Close ¶ added in v1.2.4
func (mdc *MockDiscoveryClient) Close() error
func (*MockDiscoveryClient) FindPeers ¶
func (mdc *MockDiscoveryClient) FindPeers( ctx context.Context, in *proto.FindPeersReq, ) (*proto.FindPeersResp, error)
func (*MockDiscoveryClient) HookClose ¶ added in v1.2.4
func (mdc *MockDiscoveryClient) HookClose(fn closeDelegate)
func (*MockDiscoveryClient) HookFindPeers ¶
func (mdc *MockDiscoveryClient) HookFindPeers(fn findPeersDelegate)
func (*MockDiscoveryClient) HookIsClose ¶ added in v1.2.4
func (mdc *MockDiscoveryClient) HookIsClose(fn isCloseDelegate)
func (*MockDiscoveryClient) IsClose ¶ added in v1.2.4
func (mdc *MockDiscoveryClient) IsClose() bool
type MockIdentityClient ¶
type MockIdentityClient struct {
// contains filtered or unexported fields
}
MockIdentityClient mocks an identity client (other peer in the communication)
func (*MockIdentityClient) Close ¶ added in v1.2.4
func (mic *MockIdentityClient) Close() error
func (*MockIdentityClient) HookClose ¶ added in v1.2.4
func (mic *MockIdentityClient) HookClose(fn closeDelegate)
func (*MockIdentityClient) HookHello ¶
func (mic *MockIdentityClient) HookHello(fn helloDelegate)
func (*MockIdentityClient) HookIsClose ¶ added in v1.2.4
func (mic *MockIdentityClient) HookIsClose(fn isCloseDelegate)
func (*MockIdentityClient) IsClose ¶ added in v1.2.4
func (mic *MockIdentityClient) IsClose() bool
type MockNetworkingServer ¶
type MockNetworkingServer struct {
// contains filtered or unexported fields
}
func NewMockNetworkingServer ¶
func NewMockNetworkingServer() *MockNetworkingServer
func (*MockNetworkingServer) AddPeer ¶
func (m *MockNetworkingServer) AddPeer(id peer.ID, direction network.Direction)
func (*MockNetworkingServer) AddToPeerStore ¶
func (m *MockNetworkingServer) AddToPeerStore(peerInfo *peer.AddrInfo)
func (*MockNetworkingServer) Connect ¶ added in v1.2.4
func (m *MockNetworkingServer) Connect(addrInfo peer.AddrInfo) error
func (*MockNetworkingServer) DisconnectFromPeer ¶
func (m *MockNetworkingServer) DisconnectFromPeer(peerID peer.ID, reason string)
func (*MockNetworkingServer) EmitEvent ¶
func (m *MockNetworkingServer) EmitEvent(ctx context.Context, event *event.PeerEvent)
func (*MockNetworkingServer) GetMockDiscoveryClient ¶
func (m *MockNetworkingServer) GetMockDiscoveryClient() *MockDiscoveryClient
func (*MockNetworkingServer) GetMockIdentityClient ¶
func (m *MockNetworkingServer) GetMockIdentityClient() *MockIdentityClient
func (*MockNetworkingServer) GetMockPeerMetrics ¶
func (m *MockNetworkingServer) GetMockPeerMetrics() *MockPeerMetrics
func (*MockNetworkingServer) GetPeerInfo ¶
func (m *MockNetworkingServer) GetPeerInfo(peerID peer.ID) *peer.AddrInfo
func (*MockNetworkingServer) GetRandomBootnode ¶
func (m *MockNetworkingServer) GetRandomBootnode() *peer.AddrInfo
func (*MockNetworkingServer) GetRandomPeer ¶
func (m *MockNetworkingServer) GetRandomPeer() *peer.ID
func (*MockNetworkingServer) GetTracer ¶ added in v1.2.4
func (m *MockNetworkingServer) GetTracer() telemetry.Tracer
func (*MockNetworkingServer) HasFreeConnectionSlot ¶
func (m *MockNetworkingServer) HasFreeConnectionSlot(direction network.Direction) bool
func (*MockNetworkingServer) HasPeer ¶ added in v1.2.4
func (m *MockNetworkingServer) HasPeer(peerID peer.ID) bool
func (*MockNetworkingServer) HookAddPeer ¶
func (m *MockNetworkingServer) HookAddPeer(fn addPeerDelegate)
func (*MockNetworkingServer) HookAddToPeerStore ¶
func (m *MockNetworkingServer) HookAddToPeerStore(fn addToPeerStoreDelegate)
func (*MockNetworkingServer) HookConnect ¶ added in v1.2.4
func (m *MockNetworkingServer) HookConnect(fn connectDelegate)
func (*MockNetworkingServer) HookDisconnectFromPeer ¶
func (m *MockNetworkingServer) HookDisconnectFromPeer(fn disconnectFromPeerDelegate)
func (*MockNetworkingServer) HookEmitEvent ¶
func (m *MockNetworkingServer) HookEmitEvent(fn emitEventDelegate)
func (*MockNetworkingServer) HookGetPeerInfo ¶
func (m *MockNetworkingServer) HookGetPeerInfo(fn getPeerInfoDelegate)
func (*MockNetworkingServer) HookGetRandomBootnode ¶
func (m *MockNetworkingServer) HookGetRandomBootnode(fn getRandomBootnodeDelegate)
func (*MockNetworkingServer) HookGetRandomPeer ¶
func (m *MockNetworkingServer) HookGetRandomPeer(fn getRandomPeerDelegate)
func (*MockNetworkingServer) HookGetTracer ¶ added in v1.2.4
func (m *MockNetworkingServer) HookGetTracer(fn getTraceDelegate)
func (*MockNetworkingServer) HookHasFreeConnectionSlot ¶
func (m *MockNetworkingServer) HookHasFreeConnectionSlot(fn hasFreeConnectionSlotDelegate)
func (*MockNetworkingServer) HookHasPeer ¶ added in v1.2.4
func (m *MockNetworkingServer) HookHasPeer(fn hasPeerDelegate)
func (*MockNetworkingServer) HookIsBootnode ¶ added in v1.2.4
func (m *MockNetworkingServer) HookIsBootnode(fn isBootnodeDelegate)
func (*MockNetworkingServer) HookIsStaticPeer ¶ added in v1.2.4
func (m *MockNetworkingServer) HookIsStaticPeer(fn isStaticPeerDelegate)
func (*MockNetworkingServer) HookNewDiscoveryClient ¶
func (m *MockNetworkingServer) HookNewDiscoveryClient(fn newDiscoveryClientDelegate)
func (*MockNetworkingServer) HookNewIdentityClient ¶
func (m *MockNetworkingServer) HookNewIdentityClient(fn newIdentityClientDelegate)
func (*MockNetworkingServer) HookPeerCount ¶ added in v1.2.4
func (m *MockNetworkingServer) HookPeerCount(fn peerCountDelegate)
func (*MockNetworkingServer) HookRemoveFromPeerStore ¶
func (m *MockNetworkingServer) HookRemoveFromPeerStore(fn removeFromPeerStoreDelegate)
func (*MockNetworkingServer) HookUpdatePendingConnCount ¶
func (m *MockNetworkingServer) HookUpdatePendingConnCount(fn updatePendingConnCountDelegate)
func (*MockNetworkingServer) IsBootnode ¶ added in v1.2.4
func (m *MockNetworkingServer) IsBootnode(peerID peer.ID) bool
func (*MockNetworkingServer) IsStaticPeer ¶ added in v1.2.4
func (m *MockNetworkingServer) IsStaticPeer(peerID peer.ID) bool
func (*MockNetworkingServer) NewDiscoveryClient ¶
func (m *MockNetworkingServer) NewDiscoveryClient(ctx context.Context, peerID peer.ID) (client.DiscoveryClient, error)
func (*MockNetworkingServer) NewIdentityClient ¶
func (m *MockNetworkingServer) NewIdentityClient(ctx context.Context, peerID peer.ID) (client.IdentityClient, error)
func (*MockNetworkingServer) PeerCount ¶ added in v1.2.4
func (m *MockNetworkingServer) PeerCount() int64
func (*MockNetworkingServer) RemoveFromPeerStore ¶
func (m *MockNetworkingServer) RemoveFromPeerStore(peerID peer.ID)
func (*MockNetworkingServer) UpdatePendingConnCount ¶
func (m *MockNetworkingServer) UpdatePendingConnCount(delta int64, direction network.Direction)
type MockPeerMetrics ¶
type MockPeerMetrics struct {
// contains filtered or unexported fields
}
MockPeerMetrics is a mock used by the Kademlia routing table
func (*MockPeerMetrics) HookLatencyEWMA ¶
func (m *MockPeerMetrics) HookLatencyEWMA(fn latencyEWMADelegate)
func (*MockPeerMetrics) HookRecordLatency ¶
func (m *MockPeerMetrics) HookRecordLatency(fn recordLatencyDelegate)
func (*MockPeerMetrics) HookRemoveMetricsPeer ¶
func (m *MockPeerMetrics) HookRemoveMetricsPeer(fn removeMetricsPeerDelegate)
func (*MockPeerMetrics) LatencyEWMA ¶
func (m *MockPeerMetrics) LatencyEWMA(id peer.ID) time.Duration
func (*MockPeerMetrics) RecordLatency ¶
func (m *MockPeerMetrics) RecordLatency(id peer.ID, duration time.Duration)
func (*MockPeerMetrics) RemovePeer ¶
func (m *MockPeerMetrics) RemovePeer(id peer.ID)
Click to show internal directories.
Click to hide internal directories.