out

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pretty

func Pretty(w io.Writer, format string, args ...any)

Pretty prints a short human line to w. Used by individual commands as their pretty-mode summary.

func WriteError

func WriteError(w io.Writer, pretty bool, product string, err error) error

WriteError writes an error envelope to w. Always emits JSON even in pretty mode — easier for LLM callers to diagnose regardless of flag.

func WriteSuccess

func WriteSuccess(w io.Writer, pretty bool, product string, data any) error

WriteSuccess writes a success envelope. When pretty is true, the caller is responsible for having written the human summary first; this function emits nothing in that case to avoid duplicating the payload.

Types

type Envelope

type Envelope struct {
	Success bool           `json:"success"`
	Product string         `json:"product,omitempty"`
	Data    any            `json:"data,omitempty"`
	Error   *EnvelopeError `json:"error,omitempty"`
}

type EnvelopeError

type EnvelopeError struct {
	Code       string `json:"code,omitempty"`
	Message    string `json:"message"`
	HTTPStatus int    `json:"http_status,omitempty"`
	Hint       string `json:"hint,omitempty"`
	Retryable  bool   `json:"retryable,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL