Checks the health status of the CyborgDB service. Useful for readiness/liveness checks and connectivity diagnostics.
func (c *Client) GetHealth(ctx context.Context) (map[string]string, error)

Parameters

ParameterTypeDescription
ctxcontext.ContextContext for cancellation/timeouts

Returns

TypeDescription
map[string]stringHealth status information from the server
errorAny error encountered during the health check

Exceptions

Example Usage

package main

import (
    "context"
    "fmt"
    "log"
    
    "github.com/cyborginc/cyborgdb-go"
)

func main() {
    // Create client
    client, err := cyborgdb.NewClient("http://localhost:8000", "your-api-key")
    if err != nil {
        log.Fatal(err)
    }
    
    // Check service health
    ctx := context.Background()
    health, err := client.GetHealth(ctx)
    if err != nil {
        log.Fatal("Health check failed:", err)
    }
    
    fmt.Println("Service Health Status:")
    for key, value := range health {
        fmt.Printf("  %s: %s\n", key, value)
    }
}

Response Fields

FieldTypeDescription
statusstringCurrent health status of the service (typically “healthy”)
api_versionstringVersion of the API interface (e.g., “v1”)
versionstringVersion of the CyborgDB application/service