network

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEndpointReachable added in v0.9.0

func CheckEndpointReachable(ctx context.Context, urlStr string, timeout time.Duration) error

CheckEndpointReachable verifies that a URL endpoint is reachable. It extracts the base URL (scheme + host) and performs a simple HTTP HEAD request. Returns nil if reachable, error otherwise.

func GetMachineIP

func GetMachineIP() (string, error)

GetMachineIP retrieves the first non-loopback IP address of the machine

func ProbeTCP added in v0.18.0

func ProbeTCP(ctx context.Context, addr string, overallTimeout, dialTimeout, retryDelay time.Duration) (int, error)

ProbeTCP opens a TCP connection to addr and closes it immediately. On failure it retries with retryDelay between attempts until overallTimeout elapses (or the parent context is cancelled). Each individual dial uses dialTimeout.

Returns the number of attempts made and the last dial error if all attempts failed; returns (n, nil) on the first successful connect.

Use for "is this service reachable from here" probes where MetalLB ARP convergence or Cilium reconciler latency may delay first-byte arrival but silent failure (eBPF table miss, dropped SYN) needs to surface as an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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