Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Pretty ¶
Pretty prints a short human line to w. Used by individual commands as their pretty-mode summary.
func WriteError ¶
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 ¶
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 APIError ¶ added in v0.3.11
APIError is a structured error from a Scrapfly HTTP endpoint not covered by the go-scrapfly SDK error type (e.g. the public docs search). Carrying the fields here keeps them machine-readable in the JSON error envelope so agents can self-correct instead of parsing prose.
type Envelope ¶
type Envelope struct {
Success bool `json:"success"`
Product string `json:"product,omitempty"`
Data any `json:"data,omitempty"`
Error *EnvelopeError `json:"error,omitempty"`
}