Skip to main content
Client is the entry point of the CyborgDB Go SDK. It connects to a running CyborgDB service and creates, loads, and lists encrypted indexes. Operations on an index, such as upsert and query, are methods of the *EncryptedIndex it returns. Every method that calls the service takes a context.Context first.

Constructor

Parameters

apiKey is the service authentication credential: the root key or a per-user cdbk_ token. It is required only when the service runs with CYBORGDB_SERVICE_ROOT_KEY set; against an unauthenticated service (the default), pass "". This is distinct from the service’s CYBORGDB_API_KEY license key. See Managing Keys.
NewClient returns a *ValidationError wrapping ErrInvalidURL if baseURL has no http/https scheme or no host, e.g. "localhost:8000". A path in baseURL is kept as a prefix, so https://example.com/cyborgdb sends requests to https://example.com/cyborgdb/v1/....

Example Usage

TLS verification

verifySSL decides whether the SDK checks the service’s TLS certificate:

Errors and timeouts

Failed requests return errors that wrap a typed error chosen by HTTP status, such as *NotFoundError for 404; arguments the SDK rejects before sending return a *ValidationError. See Errors. Bound each call with a context deadline: