Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCommandsTo ¶
AddCommandsTo registers every CLI subcommand onto the supplied root command and attaches global persistent flags shared by all subcommands.
func ExitCode ¶ added in v0.5.6
ExitCode is the exported entry point for main(): it returns the process exit code implied by err (see exitCode).
func GenerateSchemaDoc ¶ added in v0.8.6
GenerateSchemaDoc exposes schema generation for the cmd/shinyhub conformance tests, which exercise the full tree including server commands. The return type is any so schemaDoc stays unexported; callers consume it via json.Marshal.
func RenderAction ¶ added in v0.8.6
RenderAction is the exported form for use by cmd/shinyhub/main.go commands that live outside the cli package. It behaves identically to renderAction.
func Report ¶ added in v0.8.6
Report is the root error boundary: main() calls os.Exit(cli.Report(err)).
func SetVersion ¶
func SetVersion(v string)
SetVersion updates the version string reported by CLI subcommands. Called by the parent binary's init() so both the server (`shinyhub serve`) and the CLI subcommands report the same version.
Types ¶
type ExitCodeError ¶ added in v0.5.6
type ExitCodeError struct {
Code int
Err error
// Kind is the structured error kind for the envelope. Empty means
// classify() derives it from Code (legacy fleet paths) or falls back.
Kind Kind
// Reported is set when the command already wrote a contextual,
// user-facing message for this error. The renderer then skips the prose
// duplication; the structured envelope is still emitted.
Reported bool
}
ExitCodeError wraps an error with a specific process exit code. main() inspects the returned error chain for this type via errors.As and exits with Code; without it, cobra's default non-nil-error exit (1) applies.
Codes: 0 success/report, 1 usage/manifest/validation, 2 plan-detailed-exitcode changes-pending, 3 transport/auth, 4 partial convergence, 5 conflicts, 6 server not ready. schedule --follow commands propagate the remote job's own exit code (exit_code_passthrough).
func (*ExitCodeError) Error ¶ added in v0.5.6
func (e *ExitCodeError) Error() string
func (*ExitCodeError) Unwrap ¶ added in v0.5.6
func (e *ExitCodeError) Unwrap() error
type Kind ¶ added in v0.8.6
type Kind string
Kind is the stable machine-readable failure category carried in structured error envelopes and listed in the schema document's errors array. Consumers branch on Kind, not on message text.
const ( KindValidation Kind = "validation" KindNotFound Kind = "not_found" KindConfirmationRequired Kind = "confirmation_required" KindAuth Kind = "auth" KindNetwork Kind = "network" KindTimeout Kind = "timeout" KindRateLimit Kind = "rate_limit" KindServerError Kind = "server_error" KindPartialConvergence Kind = "partial_convergence" KindConflict Kind = "conflict" KindServerNotReady Kind = "server_not_ready" KindJobFailed Kind = "job_failed" KindInternal Kind = "internal" )
Source Files
¶
- actionout.go
- apps.go
- apps_metrics.go
- clienterr.go
- data.go
- deploy.go
- deploy_runtime.go
- env.go
- env_apply.go
- errkind.go
- errreport.go
- exitcode.go
- first_fire.go
- fleet.go
- fleet_apply.go
- fleet_apply_exec.go
- fleet_apply_report.go
- fleet_deploy.go
- fleet_digest.go
- fleet_git.go
- fleet_init.go
- fleet_manifest_resolve.go
- fleet_patch.go
- fleet_plan.go
- fleet_preflight.go
- fleet_render.go
- fleet_run.go
- fleet_status.go
- fleet_validate.go
- format.go
- listfetch.go
- listout.go
- login.go
- logout.go
- manifest.go
- manifest_summary.go
- root.go
- run.go
- schedule.go
- schedule_runs.go
- schema.go
- schema_annotations.go
- schema_cmd.go
- serverprobe.go
- share.go
- streamout.go
- users.go
- whoami.go