Documentation
¶
Index ¶
- func AddForceFlag(cmd *cobra.Command, force *bool)
- func AddOutputFlag(cmd *cobra.Command, format *string)
- func AddPaginationFlags(cmd *cobra.Command, limit, offset *int)
- func ConfirmAction(in io.Reader, errOut io.Writer, message string) bool
- func FormatError(err error) string
- func ResolveProjectID(ctx context.Context, f *Factory, input string) (string, error)
- func ResolveProjectIdentifier(ctx context.Context, f *Factory, input string) (string, error)
- type Factory
- type IOStreams
- type SilentError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddForceFlag ¶
AddForceFlag adds the --force/-f flag to a command.
func AddOutputFlag ¶
AddOutputFlag adds the --output/-o flag to a command.
func AddPaginationFlags ¶
AddPaginationFlags adds --limit and --offset flags to a command.
func ConfirmAction ¶
ConfirmAction prompts the user to confirm a destructive action. Returns true if the user confirms with "y" or "yes". If in is not interactive or the user declines, returns false.
func FormatError ¶
FormatError converts an API error into a user-friendly message.
func ResolveProjectID ¶ added in v1.10.1
ResolveProjectID resolves a project input to its numeric ID string.
Types ¶
type Factory ¶
type Factory struct {
ConfigPath string
Verbose bool
IOStreams *IOStreams
// contains filtered or unexported fields
}
Factory provides lazy access to configuration, API client, and output printer.
func NewFactory ¶
func NewFactory() *Factory
NewFactory creates a new Factory with default I/O streams.
func (*Factory) DebugLogger ¶
DebugLogger returns the debug logger, creating it on first call.
type SilentError ¶ added in v1.10.0
type SilentError struct{ Code int }
SilentError is returned when the error message has already been printed or should be suppressed. main.go will still exit with the given code.
func (*SilentError) Error ¶ added in v1.10.0
func (e *SilentError) Error() string