Bsdkrun.Args (bsdkrun_ex v0.4.0)

Copy Markdown View Source

Builds the full bsdkrun argv (minus the binary and global flags) for a detached create. Ported verbatim from the TypeScript SDK's args.ts; every path ends with -d so create yields a handle.

Options are given as a keyword list or map, discriminated on :os (:linux, :freebsd, :netbsd, :firmware, :kernel, :unikraft, :solo5, :nanos, :osv). See Bsdkrun.Sandbox.create/1 for the full set of per-kind keys.

Summary

Types

The guest kind, discriminating create/1 and mirrored by SandboxInfo.kind.

Functions

Build the create argv (a list of strings) for the given options.

Accept a keyword list or a map (atom or string keys) and return an atom-keyed map for uniform access. Exposed for Bsdkrun.Sandbox.Builder, which normalizes :net the same way create/1's options are normalized here.

Types

os()

@type os() ::
  :linux
  | :freebsd
  | :netbsd
  | :firmware
  | :kernel
  | :unikraft
  | :solo5
  | :nanos
  | :osv

The guest kind, discriminating create/1 and mirrored by SandboxInfo.kind.

Functions

build_create(opts)

@spec build_create([keyword() | map()]) :: [String.t()]

Build the create argv (a list of strings) for the given options.

normalize(opts)

@spec normalize(keyword() | map()) :: map()

Accept a keyword list or a map (atom or string keys) and return an atom-keyed map for uniform access. Exposed for Bsdkrun.Sandbox.Builder, which normalizes :net the same way create/1's options are normalized here.