{"modulePath":"github.com/PMOCK-dot/pmock-cli","version":"v0.1.20","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package exitcode\n\nPackage exitcode defines the process exit contract shared by every command.\n\nThe contract is intentionally strict so scripts and agents can branch on the exit code instead of parsing stderr:\n\n\t0  success\n\t1  business failure (API envelope code is not 0/200)\n\t2  usage or configuration error (nothing was sent)\n\t3  runtime failure (network, timeout, 5xx, malformed response)\n\nThe API envelope is still written to stdout for 1, so \\`... | jq .code\\` keeps working.\n\n## Constants\n\n```go\nconst (\n\tOK       = 0\n\tBusiness = 1\n\tUsage    = 2\n\tRuntime  = 3\n)\n```\n\n## Functions\n\n```go\nfunc Businessf(format string, args ...any) error\n```\nBusinessf reports an API-level failure that has already been rendered.\n\n```go\nfunc CodeOf(err error) int\n```\nCodeOf returns the exit code carried by err, or Runtime for unknown errors.\n\n```go\nfunc IsQuiet(err error) bool\n```\nIsQuiet reports whether the error should be printed to stderr.\n\n```go\nfunc New(code int, err error) error\n```\nNew builds an exit-code error.\n\n```go\nfunc Runtimef(format string, args ...any) error\n```\nRuntimef reports an environmental failure: network, timeout, 5xx.\n\n```go\nfunc Usagef(format string, args ...any) error\n```\nUsagef reports a caller mistake: bad flag, missing required field, bad JSON.\n\n## Types\n\n```go\ntype Error struct {\n\tCode int\n\tErr  error\n\t// Quiet suppresses the \"Error: ...\" line on stderr. Business failures use\n\t// it because the envelope on stdout is already the machine-readable error.\n\tQuiet bool\n}\n```\nError wraps an error with the exit code the process should use.\n\n```go\nfunc (e *Error) Error() string\n```\n\n```go\nfunc (e *Error) Unwrap() error\n```\n\n","path":"github.com/PMOCK-dot/pmock-cli/internal/exitcode","name":"exitcode","synopsis":"Package exitcode defines the process exit contract shared by every command.","isRedistributable":true}
