Documentation
¶
Overview ¶
Package cli holds the conventions every ossein command-line binary follows — the process logger, the --log-level vocabulary, the exit-status convention, the spelling of "the whole host" on --cpus and --memory — so that ossein and its docker-shaped front (cmd/ossein-docker) behave as one product without either importing the other's main package.
Index ¶
Constants ¶
const ExitInternal = 125
ExitInternal is docker's runtime-error exit convention (125): a failure of the tool itself must be distinguishable from a workload that exited 1.
const LogLevels = "debug,info,warn,error"
LogLevels is the accepted --log-level vocabulary, for kong's enum tag. Keep it in sync with NewLogger's switch: the enum is what admits a name, the switch is what it means.
const WholeHost = 0
WholeHost is the --cpus / --memory value that means "everything the host has": docker's own spelling of no limit, and what the docker-shaped front passes when a script sizes nothing. ossein resolves it against what Virtualization.framework allows (pkg/vm HostMaxCPUs, HostMaxMemoryMiB); the front never computes it, because only the side that links the framework knows the ceiling.
Variables ¶
This section is empty.
Functions ¶
func NewLogger ¶
NewLogger installs the process slog logger via primordium: a human-friendly tint handler when stderr is a TTY, structured JSON otherwise. Diagnostics go to stderr; stdout is reserved for machine-readable contracts (BUILDKIT_HOST, digests, version). level is a --log-level value already validated by the kong enum (LogLevels). It returns the installed default logger so the caller can inject it into command Run methods.
Types ¶
This section is empty.