KubeMQ.Config (kubemq v1.0.1)

Copy Markdown View Source

Configuration for KubeMQ client connections via NimbleOptions.

All timeouts are in milliseconds, matching Elixir/Erlang convention. The SDK converts internally for proto fields that use different units.

Unit Conversions

User-Facing FieldUser UnitProto FieldProto UnitConversion
default_cache_ttlmsCacheTTLsecondsdiv(ms, 1000)
cache_ttl (Query)msCacheTTLsecondsdiv(ms, 1000)
wait_timeout (Simple)msWaitTimeSecondssecondsdiv(ms, 1000)
wait_timeout (Stream)msWaitTimeoutmspass-through
start_at_time_deltamsEventsStoreTypeValuesecondsdiv(ms, 1000)
timeout (CQ)msTimeoutmspass-through

Summary

Functions

Validate and apply defaults to client options.

Validate and apply defaults to client options, raising on invalid input.

Functions

schema()

@spec schema() :: keyword()

validate(opts)

@spec validate(keyword()) ::
  {:ok, keyword()} | {:error, NimbleOptions.ValidationError.t()}

Validate and apply defaults to client options.

Returns {:ok, validated_opts} on success or {:error, validation_error} on failure.

Examples

iex> {:ok, opts} = KubeMQ.Config.validate(client_id: "test")
iex> Keyword.get(opts, :client_id)
"test"

iex> {:error, %NimbleOptions.ValidationError{}} = KubeMQ.Config.validate([])

validate!(opts)

@spec validate!(keyword()) :: keyword()

Validate and apply defaults to client options, raising on invalid input.

Returns the validated keyword list with all defaults applied. Raises NimbleOptions.ValidationError if validation fails.

Examples

iex> opts = KubeMQ.Config.validate!(client_id: "my-app")
iex> Keyword.get(opts, :address)
"localhost:50000"