trackermock

package
v1.22.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package trackermock provides mock implementations for connection tracking

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionInfo

type ConnectionInfo struct {
	NodeID         ids.NodeID
	Connected      bool
	ConnectedAt    time.Time
	DisconnectedAt time.Time
	BytesSent      uint64
	BytesReceived  uint64
}

ConnectionInfo holds connection information

type MockTracker

type MockTracker struct {
	// contains filtered or unexported fields
}

MockTracker provides a mock implementation for connection tracking

func NewMockTracker

func NewMockTracker() *MockTracker

NewMockTracker creates a new mock tracker

func (*MockTracker) Connected

func (m *MockTracker) Connected(nodeID ids.NodeID)

Connected marks a node as connected

func (*MockTracker) Disconnected

func (m *MockTracker) Disconnected(nodeID ids.NodeID)

Disconnected marks a node as disconnected

func (*MockTracker) GetConnectionInfo

func (m *MockTracker) GetConnectionInfo(nodeID ids.NodeID) *ConnectionInfo

GetConnectionInfo returns connection info for a node

func (*MockTracker) IsConnected

func (m *MockTracker) IsConnected(nodeID ids.NodeID) bool

IsConnected checks if a node is connected

func (*MockTracker) Reset

func (m *MockTracker) Reset()

Reset clears all tracking data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL