KdrantConfig

class KdrantConfig(val host: String, val port: Int, val apiKey: String? = null, val useTls: Boolean = false, val requestTimeout: Duration = 30.seconds, val connectTimeout: Duration? = null, val socketTimeout: Duration? = null, val maxRetries: Int = 3, val retryBaseDelay: Duration = 500.milliseconds, val retryMaxDelay: Duration = 5.seconds, val dispatcher: CoroutineDispatcher = ioDispatcher, val bearerToken: String? = null, val trustAnchors: TrustAnchors = TrustAnchors.System)

Resolved, immutable connection configuration for a Kdrant client.

Credentials

apiKey is the cluster's master key: full read and write over every collection. bearerToken is a Qdrant JWT, which carries claims that narrow it — read-only, a named collection, or a payload filter deciding which points the caller may see at all. Exactly one of the two, or neither.

A credential is refused over plaintext HTTP unless host is a loopback address, because a key sent in the clear across a network is a key someone else has. A request to 127.0.0.1 never reaches a network, which is why a local node with an API key needs no certificate.

Constructors

Link copied to clipboard
constructor(host: String, port: Int, apiKey: String? = null, useTls: Boolean = false, requestTimeout: Duration = 30.seconds, connectTimeout: Duration? = null, socketTimeout: Duration? = null, maxRetries: Int = 3, retryBaseDelay: Duration = 500.milliseconds, retryMaxDelay: Duration = 5.seconds, dispatcher: CoroutineDispatcher = ioDispatcher, bearerToken: String? = null, trustAnchors: TrustAnchors = TrustAnchors.System)

Properties

Link copied to clipboard

API key sent as the api-key header; null disables auth.

Link copied to clipboard

Qdrant JWT sent as Authorization: Bearer; mutually exclusive with apiKey.

Link copied to clipboard

timeout for establishing a connection; null uses the engine default.

Link copied to clipboard
val dispatcher: CoroutineDispatcher

dispatcher the client runs on; injectable for tests. The default is platform-dependent, see ioDispatcher.

Link copied to clipboard

Qdrant host.

Link copied to clipboard

how many times to retry a retryable failure (HTTP 429/502/503/504 and transient I/O errors) with exponential backoff + jitter. 0 disables retries.

Link copied to clipboard
val port: Int

Qdrant port (1..65535).

Link copied to clipboard

per-request timeout (applies to each attempt).

Link copied to clipboard

base delay before the first retry; each subsequent retry backs off exponentially, capped at retryMaxDelay. The server's Retry-After is honored when present.

Link copied to clipboard

upper bound on a single retry delay.

Link copied to clipboard

maximum idle time between two data packets on an open connection; null uses the engine default.

Link copied to clipboard

which certificates TLS will accept. The default is the platform's own store; see TrustAnchors for what each platform reads and which options it can honour. Ignored when useTls is false, because there is no certificate to judge.

Link copied to clipboard

use HTTPS instead of HTTP.

Functions

Link copied to clipboard
open override fun toString(): String

Renders the config without exposing either credential, so it is safe to log.