Skip to content
OpenShell
You are viewing Go SDK 0.1.7. The latest version is 0.1.8. Go to the latest version.

Health

Accessor: client.Health()

Check the health status of the connected OpenShell gateway.

Perform a health check against the gateway. Returns the overall status and component-level details.

result, err := client.Health().Check(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Gateway healthy: %v\n", result.Healthy)

This is useful for readiness probes or verifying connectivity before executing other operations.

// Quick connectivity check before starting work
if result, err := client.Health().Check(ctx); err != nil {
log.Fatalf("Gateway unreachable: %v", err)
} else if !result.Healthy {
log.Fatal("Gateway is not healthy")
}

See also: Error Handling

We are a Cloud Native Computing Foundation sandbox project.