Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatHealthMessage ¶
func FormatHealthMessage(result HealthCheckResult, targetURL *url.URL) string
FormatHealthMessage creates a user-friendly health status message
Types ¶
type HealthCheckResult ¶
type HealthCheckResult struct {
Status ServerHealthStatus
Healthy bool
Error error
Timestamp time.Time
Duration time.Duration
}
HealthCheckResult contains the result of a health check
func CheckServerHealth ¶
CheckServerHealth performs a connection check to verify a server is listening. For HTTPS URLs, it performs a TLS handshake to avoid incomplete handshake warnings on the server side. The insecure parameter controls whether to skip TLS certificate verification (matching the --insecure flag behavior for webhook forwarding). The timeout parameter should be appropriate for the deployment context: - Local development: 3s is typically sufficient - Production/edge: May require longer timeouts due to network conditions
type ServerHealthStatus ¶
type ServerHealthStatus int
ServerHealthStatus represents the health status of the target server
const ( HealthHealthy ServerHealthStatus = iota // TCP connection successful HealthUnreachable // Connection refused or timeout )