Documentation
¶
Overview ¶
Package netcheck is the network reachability + VPN status probe. Network actions can hang when a host sits behind a VPN that isn't connected; this gives a fast bounded reachability check and a best-effort VPN indicator so commands fail fast with an actionable message. stdlib only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SSHReachable ¶
SSHReachable is true if the SSH layer on host:port responds within timeout - a stronger check than TCPReachable for VPN-gated hosts on HTTPS-style ports that accept TCP but never complete the SSH banner. A live server (even one that rejects auth) counts as reachable; a hang/refusal does not.
func TCPReachable ¶
TCPReachable is true if a TCP connection to host:port opens within timeout.
func VPNActive ¶
func VPNActive() *bool
VPNActive is a heuristic: is a VPN/tunnel interface present? nil when undeterminable (mirrors v1's bool | None).
func VPNInterfaces ¶
func VPNInterfaces() []string
VPNInterfaces is the live list of tunnel/VPN-like interfaces present.
Types ¶
type NetStatus ¶
type NetStatus struct {
Host string
Port int
Reachable bool
RequiresVPN bool
VPNName string // "" == none
VPNURL string // "" == none
VPN *bool // nil == undeterminable
}
NetStatus is the reachability of one host:port with a VPN-aware message.