Documentation
¶
Index ¶
- Constants
- Variables
- func ExitCodeFor(err error) int
- func NormalizeJSONNumbers(data []byte) (any, error)
- func TruncationNotice(shown, total int) string
- func TruncationNoticeWithCmd(shown, total int, cmd string) string
- func ValidateJQFilter(filter string) error
- type Breadcrumb
- type Error
- type ErrorResponse
- type Format
- type Options
- type Response
- type ResponseOption
- type Writer
Constants ¶
View Source
const ( ExitOK = 0 ExitUsage = 1 ExitNotFound = 2 ExitAuth = 3 ExitForbidden = 4 ExitRateLimit = 5 ExitNetwork = 6 ExitAPI = 7 ExitAmbiguous = 8 )
Variables ¶
View Source
var ( ErrUsage = apierr.ErrUsage ErrUsageHint = apierr.ErrUsageHint ErrNotFound = apierr.ErrNotFound ErrAuth = apierr.ErrAuth ErrForbidden = apierr.ErrForbidden ErrRateLimit = apierr.ErrRateLimit ErrNetwork = apierr.ErrNetwork ErrAPI = apierr.ErrAPI ErrAmbiguous = apierr.ErrAmbiguous AsError = apierr.AsError )
Functions ¶
func ExitCodeFor ¶
func NormalizeJSONNumbers ¶
func TruncationNotice ¶
func TruncationNoticeWithCmd ¶
func ValidateJQFilter ¶ added in v0.1.1
ValidateJQFilter confirms that a built-in jq expression is ready to run.
Types ¶
type Breadcrumb ¶
type Error ¶
Error is a typed error with a code, message, and optional fields. Alias for apierr.Error so that cmd-layer code can use output.Error without importing the domain package directly.
func ErrJQConflict ¶ added in v0.1.1
ErrJQConflict reports an output flag that cannot be combined with --jq.
func ErrJQNotSupported ¶ added in v0.1.1
ErrJQNotSupported reports a command that produces a dedicated raw format.
func ErrJQRuntime ¶ added in v0.1.1
ErrJQRuntime reports a failure while evaluating a built-in jq expression.
func ErrJQValidation ¶ added in v0.1.1
ErrJQValidation reports an invalid built-in jq expression.
type ErrorResponse ¶
type ResponseOption ¶
type ResponseOption func(*Response)
func WithBreadcrumbs ¶
func WithBreadcrumbs(b ...Breadcrumb) ResponseOption
func WithMeta ¶
func WithMeta(key string, value any) ResponseOption
func WithNotice ¶
func WithNotice(s string) ResponseOption
func WithSummary ¶
func WithSummary(s string) ResponseOption
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func (*Writer) EffectiveFormat ¶
Click to show internal directories.
Click to hide internal directories.