{"modulePath":"github.com/duynguyendang/manglekit","version":"v0.13.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package exitcode\n\nPackage exitcode defines the mkit CLI exit-code contract and maps errors to exit codes. Keep in sync with the root command help text in cmd/mkit/main.go.\n\n## Constants\n\n```go\nconst (\n\t// Success means the command completed without error.\n\tSuccess = 0\n\t// PolicyDeny means a governance policy blocked the requested action.\n\tPolicyDeny = 1\n\t// Usage means the command was invoked with invalid flags or arguments.\n\tUsage = 2\n\t// Runtime means the command failed for an operational reason\n\t// (I/O, engine, provider failures).\n\tRuntime = 3\n)\n```\nmkit exit codes. Documented in the root command help.\n\n## Functions\n\n```go\nfunc CodeFor(err error) int\n```\nCodeFor maps an error to the mkit exit code.\n\n```go\nfunc IsUsageError(err error) bool\n```\nIsUsageError reports whether err was caused by invalid CLI usage.\n\n```go\nfunc UsageErrorf(format string, args ...any) error\n```\nUsageErrorf returns an error that maps to the Usage exit code.\n\n## Types\n\n```go\ntype UsageError struct {\n\tErr error\n}\n```\nUsageError marks errors caused by invalid CLI usage (bad flags or arguments). The CLI exits with code Usage for these.\n\n```go\nfunc (e *UsageError) Error() string\n```\n\n```go\nfunc (e *UsageError) Unwrap() error\n```\n\n","path":"github.com/duynguyendang/manglekit/cmd/mkit/commands/exitcode","name":"exitcode","synopsis":"Package exitcode defines the mkit CLI exit-code contract and maps errors to exit codes.","isRedistributable":true}
