connectivity

package
v1.0.32 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostPingResult

type HostPingResult struct {
	HostName string
	Status   PingStatus
	Error    error
	Duration time.Duration
}

HostPingResult represents the result of pinging a host

type PingManager

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

PingManager manages SSH connectivity checks for multiple hosts

func NewPingManager

func NewPingManager(timeout time.Duration) *PingManager

NewPingManager creates a new ping manager with the specified timeout

func (*PingManager) GetResult

func (pm *PingManager) GetResult(hostName string) (*HostPingResult, bool)

GetResult returns the complete result for a host

func (*PingManager) GetStatus

func (pm *PingManager) GetStatus(hostName string) PingStatus

GetStatus returns the current status for a host

func (*PingManager) PingAllHosts

func (pm *PingManager) PingAllHosts(ctx context.Context, hosts []config.SSHHost) <-chan *HostPingResult

PingAllHosts pings all hosts concurrently and returns a channel of results

func (*PingManager) PingHost

func (pm *PingManager) PingHost(ctx context.Context, host config.SSHHost) *HostPingResult

PingHost performs an SSH connectivity check for a single host

type PingStatus

type PingStatus int

PingStatus represents the connectivity status of an SSH host

const (
	StatusUnknown PingStatus = iota
	StatusConnecting
	StatusOnline
	StatusOffline
)

func (PingStatus) String

func (s PingStatus) String() string

Jump to

Keyboard shortcuts

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