Skip to main content
Client is the main struct exposed by the CyborgDB Go SDK. It provides a high-level interface to interact with the CyborgDB vector database service, allowing you to create and manage encrypted indexes.

Constructor

Creates a new CyborgDB Client instance for connecting to a CyborgDB microservice.

Parameters

You can get an API key from the CyborgDB Admin Dashboard. For more info, follow this guide.

Example Usage

Error Handling

The Client struct includes comprehensive error handling that processes different types of API errors:
  • HTTP Errors: Status codes and response details are logged and converted to meaningful error messages
  • Validation Errors: Field validation failures are formatted with detailed information
  • Network Errors: Connection and timeout issues are handled gracefully
All methods return Go-idiomatic error values as the second return parameter for easy error checking and handling in your application.

Type Safety

The Go SDK provides full type safety with strongly typed method parameters and return values, IDE support with autocomplete and documentation, and compile-time validation of API usage.

Error Variables

The SDK exports specific error variables that you can check for particular error conditions:

Client Errors

EncryptedIndex Errors

Example Usage