ExDaytona.Transport (ex_daytona v0.2.0)

Copy Markdown View Source

Injectable transports for the SDK's streaming paths.

Ordinary request/response calls already accept custom Tesla adapters and middleware; the streaming paths (chunked HTTP log follows, file transfer, websockets) historically bound directly to Finch and Mint. These narrow behaviours make them replaceable — primarily so tests can deterministically simulate partial bodies, stalls, disconnects, and malformed frames:

{:ok, client} =
  ExDaytona.Client.new(
    api_key: key,
    transports: [http_stream: MyFakeHTTPStream, websocket: MyFakeWS]
  )

The selection is carried on the ExDaytona.Client and flows into every derived toolbox connection, log stream, PTY, and file transfer. This is a testing seam, not a general transport framework — the behaviours are intentionally minimal.

Summary

Types

t()

The transport selection carried on a client.

Functions

Resolve a :transports option (keyword or map, possibly partial) to a full transport map.

Types

t()

@type t() :: %{http_stream: module(), websocket: module()}

The transport selection carried on a client.

Functions

resolve(overrides)

@spec resolve(keyword() | map() | nil) :: t()

Resolve a :transports option (keyword or map, possibly partial) to a full transport map.