Qx.Remote.Config (Qx - Quantum Computing Simulator v0.5.0)

View Source

Configuration for connecting to a QxServer instance.

Fields

  • :url - Base URL of the qx_server (required), e.g. "http://localhost:4040"
  • :api_key - API key for authentication (optional, depends on server config)
  • :timeout - HTTP request timeout in milliseconds (default: 300_000 = 5 min)

Examples

config = Qx.Remote.Config.new!(url: "http://localhost:4040", api_key: "my-key")

{:ok, config} = Qx.Remote.Config.new(url: "http://localhost:4040")

Summary

Functions

Creates a new remote config.

Creates a new remote config, raising on invalid input.

Types

t()

@type t() :: %Qx.Remote.Config{
  api_key: String.t() | nil,
  timeout: pos_integer(),
  url: String.t()
}

Functions

new(opts)

@spec new(keyword()) :: {:ok, t()} | {:error, String.t()}

Creates a new remote config.

Options

  • :url - Base URL of the qx_server (required)
  • :api_key - API key for authentication (optional)
  • :timeout - HTTP request timeout in milliseconds (default: 300_000)

Returns

  • {:ok, %Config{}} on success
  • {:error, reason} on validation failure

Examples

{:ok, config} = Qx.Remote.Config.new(url: "http://localhost:4040")

new!(opts)

@spec new!(keyword()) :: t()

Creates a new remote config, raising on invalid input.

Examples

config = Qx.Remote.Config.new!(
  url: "http://localhost:4040",
  api_key: System.get_env("QX_SERVER_API_KEY")
)