Documentation
¶
Index ¶
Constants ¶
const ( ExitOK = 0 // success ExitError = 1 // generic/unexpected failure ExitUsage = 2 // invalid flags or arguments ExitConfig = 3 // configuration or authentication problem ExitNotFound = 4 // requested resource does not exist ExitConflict = 5 // resource conflict (e.g. already exists) ExitValidation = 6 // request rejected by server validation ExitNetwork = 7 // network failure / transient server error after retries )
Exit codes form part of the agent contract. They are stable and documented in the README so scripts can branch on failure class without parsing text.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
func Main() int
Main is the program entry point. It returns the process exit code. It wires the real process streams and the signal-derived context, then defers all contract behaviour to run; keeping Main this thin means the subprocess smoke test (which execs the real binary) covers every branch it adds over run.
func NewRootCommand ¶
NewRootCommand builds the root command and wires every subcommand to the supplied factory.
Types ¶
type Factory ¶
type Factory struct {
In io.Reader
Out io.Writer
Err io.Writer
// contains filtered or unexported fields
}
Factory builds the per-invocation dependencies (config, client, printer) from the global flags and environment. It is the single seam the commands depend on, which keeps them thin and testable.