cli

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 3 Imported by: 0

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

View Source
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.

View Source
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.

View Source
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

func NewLogger(level string) *slog.Logger

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL