Versions in this module Expand all Collapse all v0 v0.1.1 Mar 5, 2026 v0.1.0 Mar 5, 2026 Changes in this version + const CodeAPI + const CodeAmbiguous + const CodeAuth + const CodeForbidden + const CodeNetwork + const CodeNotFound + const CodeRateLimit + const CodeUsage + const ExitAPI + const ExitAmbiguous + const ExitAuth + const ExitForbidden + const ExitNetwork + const ExitNotFound + const ExitOK + const ExitRateLimit + const ExitUsage + func ExitCodeFor(code string) int + func NormalizeData(data any) any + func TruncationNotice(count, defaultLimit int, all bool, explicitLimit int) string + func TruncationNoticeWithTotal(count, totalCount int) string + type Breadcrumb struct + Action string + Cmd string + Description string + type Error struct + Cause error + Code string + HTTPStatus int + Hint string + Message string + Retryable bool + func AsError(err error) *Error + func ErrAPI(status int, msg string) *Error + func ErrAmbiguous(resource string, matches []string) *Error + func ErrAuth(msg string) *Error + func ErrForbidden(msg string) *Error + func ErrForbiddenScope() *Error + func ErrNetwork(cause error) *Error + func ErrNotFound(resource, identifier string) *Error + func ErrNotFoundHint(resource, identifier, hint string) *Error + func ErrRateLimit(retryAfter int) *Error + func ErrUsage(msg string) *Error + func ErrUsageHint(msg, hint string) *Error + func (e *Error) Error() string + func (e *Error) ExitCode() int + func (e *Error) Unwrap() error + type ErrorResponse struct + Code string + Error string + Hint string + Meta map[string]any + OK bool + type ErrorResponseOption func(*ErrorResponse) + type Format int + const FormatAuto + const FormatCount + const FormatIDs + const FormatJSON + const FormatMarkdown + const FormatQuiet + const FormatStyled + type Options struct + Format Format + Verbose bool + Writer io.Writer + func DefaultOptions() Options + type Response struct + Breadcrumbs []Breadcrumb + Context map[string]any + Data any + Meta map[string]any + Notice string + OK bool + Summary string + type ResponseOption func(*Response) + func WithBreadcrumbs(b ...Breadcrumb) ResponseOption + func WithContext(key string, value any) ResponseOption + func WithMeta(key string, value any) ResponseOption + func WithNotice(s string) ResponseOption + func WithSummary(s string) ResponseOption + func WithoutBreadcrumbs() ResponseOption + type Writer struct + func New(opts Options) *Writer + func (w *Writer) EffectiveFormat() Format + func (w *Writer) Err(err error, opts ...ErrorResponseOption) error + func (w *Writer) OK(data any, opts ...ResponseOption) error