Documentation
¶
Index ¶
- type HostPingResult
- type PingManager
- func (pm *PingManager) GetResult(hostName string) (*HostPingResult, bool)
- func (pm *PingManager) GetStatus(hostName string) PingStatus
- func (pm *PingManager) PingAllHosts(ctx context.Context, hosts []config.SSHHost) <-chan *HostPingResult
- func (pm *PingManager) PingHost(ctx context.Context, host config.SSHHost) *HostPingResult
- type PingStatus
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
Click to show internal directories.
Click to hide internal directories.