Bsdkrun.Types (bsdkrun_ex v0.3.0)

Copy Markdown View Source

Typed structs mirroring bsdkrun's JSON output, plus mapping helpers that turn a decoded --json row (string keys) into the corresponding struct.

Summary

Functions

Map a GraphQL CommandResult row to a CommandResult struct.

Map an images --json row to an ImageInfo.

Map a network ls --json row to a NetworkInfo.

Map a ports row (from a ps --json row) to a PortForward.

Map a ps --json row to a SandboxInfo.

Map a GraphQL Machine row (camelCase keys, as selected by Bsdkrun.Client's MACHINE_FIELDS) to a SandboxInfo — the same struct sandbox_info/1 builds from the CLI's ps --json, just sourced from the daemon instead.

Map a GraphQL ShellSessionInfo row to a ShellSessionInfo struct.

Map a volume ls --json row to a VolumeInfo.

Functions

command_result_from_graphql(row)

@spec command_result_from_graphql(map()) :: Bsdkrun.Types.CommandResult.t()

Map a GraphQL CommandResult row to a CommandResult struct.

image_info(row)

@spec image_info(map()) :: Bsdkrun.Types.ImageInfo.t()

Map an images --json row to an ImageInfo.

network_info(row)

@spec network_info(map()) :: Bsdkrun.Types.NetworkInfo.t()

Map a network ls --json row to a NetworkInfo.

port_forward(row)

@spec port_forward(map()) :: Bsdkrun.Types.PortForward.t()

Map a ports row (from a ps --json row) to a PortForward.

sandbox_info(row)

@spec sandbox_info(map()) :: Bsdkrun.Types.SandboxInfo.t()

Map a ps --json row to a SandboxInfo.

sandbox_info_from_graphql(row)

@spec sandbox_info_from_graphql(map()) :: Bsdkrun.Types.SandboxInfo.t()

Map a GraphQL Machine row (camelCase keys, as selected by Bsdkrun.Client's MACHINE_FIELDS) to a SandboxInfo — the same struct sandbox_info/1 builds from the CLI's ps --json, just sourced from the daemon instead.

shell_session_info_from_graphql(row)

@spec shell_session_info_from_graphql(map()) :: Bsdkrun.Types.ShellSessionInfo.t()

Map a GraphQL ShellSessionInfo row to a ShellSessionInfo struct.

volume_info(row)

@spec volume_info(map()) :: Bsdkrun.Types.VolumeInfo.t()

Map a volume ls --json row to a VolumeInfo.