Liking cljdoc? Tell your friends :D

bsdkrun.types

Pure functions turning a parsed CLI JSON row (a Clojure map with string keys, as clojure.data.json/read-str produces without :key-fn keyword — the CLI's JSON is already snake_case) into a kebab-case-keyword map. One function per row shape, mirroring sdk/ruby/lib/bsdkrun/types.rb.

Also provides the Result-map helpers: since a bsdkrun.sandbox exec/agent result here is a plain map ({:stdout ... :stderr ... :exit-code ... :command ...}), not an object with methods, ok?, text, json, lines and throw-if-failed! are given as functions operating on that map instead.

Pure functions turning a parsed CLI JSON row (a Clojure map with *string*
keys, as `clojure.data.json/read-str` produces without `:key-fn keyword` —
the CLI's JSON is already snake_case) into a kebab-case-keyword map. One
function per row shape, mirroring `sdk/ruby/lib/bsdkrun/types.rb`.

Also provides the `Result`-map helpers: since a bsdkrun.sandbox exec/agent
result here is a plain map (`{:stdout ... :stderr ... :exit-code ...
:command ...}`), not an object with methods, [[ok?]], [[text]], [[json]],
[[lines]] and [[throw-if-failed!]] are given as functions operating on that
map instead.
raw docstring

command-result-from-graphqlclj

(command-result-from-graphql r)

The outcome of a bsdkrun.client lifecycle mutation (stopMachine, startMachine, removeMachines, updateMachine, commitMachine, ...). A non-zero :exit-code is a value to inspect, not necessarily a failure — mirrors daemon/src/graphql.rs's CommandResult.

The outcome of a `bsdkrun.client` lifecycle mutation (`stopMachine`,
`startMachine`, `removeMachines`, `updateMachine`, `commitMachine`, ...). A
non-zero `:exit-code` is a value to inspect, not necessarily a failure —
mirrors `daemon/src/graphql.rs`'s `CommandResult`.
sourceraw docstring

image-info-from-rowclj

(image-info-from-row row)

An image as reported by bsdkrun images --json.

An image as reported by `bsdkrun images --json`.
sourceraw docstring

jsonclj

(json result)

A Result's stdout, parsed as JSON.

A Result's stdout, parsed as JSON.
sourceraw docstring

linesclj

(lines result)

A Result's non-empty stdout lines.

A Result's non-empty stdout lines.
sourceraw docstring

network-info-from-rowclj

(network-info-from-row row)

A global network as reported by bsdkrun network ls --json.

A global network as reported by `bsdkrun network ls --json`.
sourceraw docstring

ok?clj

(ok? result)

Whether a Result map succeeded (exit 0).

Whether a Result map succeeded (exit 0).
sourceraw docstring

port-forward-from-rowclj

(port-forward-from-row row)

A host<->guest TCP port forward, as reported nested under ports in a ps --json row.

A host<->guest TCP port forward, as reported nested under `ports` in a
`ps --json` row.
sourceraw docstring

read-json-rowsclj

(read-json-rows s)

Parse s (raw CLI stdout) as a JSON array, defaulting to [] for empty output — mirrors every list-style call site's JSON.parse(stdout.empty? ? "[]" : stdout).

Parse `s` (raw CLI stdout) as a JSON array, defaulting to `[]` for empty
output — mirrors every `list`-style call site's
`JSON.parse(stdout.empty? ? "[]" : stdout)`.
sourceraw docstring

sandbox-info-from-graphqlclj

(sandbox-info-from-graphql m)

A machine as reported by the daemon's GraphQL API — a Machine object decoded straight from JSON (camelCase string keys), unlike sandbox-info-from-row's snake_case CLI rows. Same kebab-case-keyword shape either way, so callers of bsdkrun.sandbox and bsdkrun.client see identical SandboxInfo maps regardless of transport.

m is a MACHINE_FIELDS-shaped map (see bsdkrun.client), e.g. from bsdkrun.client/list-machines or bsdkrun.client/get-machine.

A machine as reported by the daemon's GraphQL API — a `Machine` object
decoded straight from JSON (camelCase string keys), unlike
[[sandbox-info-from-row]]'s snake_case CLI rows. Same kebab-case-keyword
shape either way, so callers of `bsdkrun.sandbox` and `bsdkrun.client` see
identical `SandboxInfo` maps regardless of transport.

`m` is a `MACHINE_FIELDS`-shaped map (see `bsdkrun.client`), e.g. from
`bsdkrun.client/list-machines` or `bsdkrun.client/get-machine`.
sourceraw docstring

sandbox-info-from-rowclj

(sandbox-info-from-row row)

A machine as reported by bsdkrun ps --json.

A machine as reported by `bsdkrun ps --json`.
sourceraw docstring

shell-session-info-from-graphqlclj

(shell-session-info-from-graphql s)

An open interactive shell session, as reported by openShell / the shellSessions query. Mirrors daemon/src/graphql.rs's ShellSessionInfo.

An open interactive shell session, as reported by `openShell` / the
`shellSessions` query. Mirrors `daemon/src/graphql.rs`'s
`ShellSessionInfo`.
sourceraw docstring

textclj

(text result)

A Result's stdout with trailing newlines trimmed — the common case.

A Result's stdout with trailing newlines trimmed — the common case.
sourceraw docstring

throw-if-failed!clj

(throw-if-failed! result)

Throw errors/command-failed if result exited non-zero; otherwise return it unchanged.

Throw `errors/command-failed` if `result` exited non-zero; otherwise
return it unchanged.
sourceraw docstring

volume-info-from-rowclj

(volume-info-from-row row)

A volume as reported by bsdkrun volume ls --json.

A volume as reported by `bsdkrun volume ls --json`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close