Documentation
¶
Index ¶
- func AssumeYes(cmd *cobra.Command) bool
- func ClientFromCommand(cmd *cobra.Command) (*client.Client, error)
- func Confirm(cmd *cobra.Command, prompt string) (bool, error)
- func DecodeJSON[T any](resp *http.Response, out *T) error
- func EffectiveLimit(cmd *cobra.Command, resource, flagName string, flagValue, fallbackDefault int) int
- func EnsureSuccessStatus(resp *http.Response) error
- func JSONOutputEnabled(cmd *cobra.Command) bool
- func ParseResourceLimit(pair string) (resource string, limit int, ok bool)
- func PrintJSON(v any) error
- func ResolveOutputMode(mode string) (runtimectx.OutputMode, error)
- func UnauthClientFromCommand(cmd *cobra.Command) (*client.Client, error)
- type HTTPStatusError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientFromCommand ¶
ClientFromCommand returns a configured authenticated client for the command.
func DecodeJSON ¶
DecodeJSON decodes JSON into out and enforces a successful HTTP status.
func EffectiveLimit ¶
func EffectiveLimit(cmd *cobra.Command, resource, flagName string, flagValue, fallbackDefault int) int
EffectiveLimit resolves the final list limit with precedence: explicit flag > per-resource config > global config > fallback default.
func EnsureSuccessStatus ¶
EnsureSuccessStatus returns an error for non-2xx responses.
func JSONOutputEnabled ¶
JSONOutputEnabled returns true if JSON output is enabled for this command.
func ParseResourceLimit ¶
ParseResourceLimit parses a "resource=limit" pair.
func ResolveOutputMode ¶
func ResolveOutputMode(mode string) (runtimectx.OutputMode, error)
ResolveOutputMode validates a free-form output mode value.
Types ¶
type HTTPStatusError ¶
HTTPStatusError represents a non-2xx HTTP response.
func (*HTTPStatusError) Error ¶
func (e *HTTPStatusError) Error() string
Click to show internal directories.
Click to hide internal directories.