Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatFor ¶
FormatFor resolves the output format for a command: --format flag takes precedence, falling back to the configured default.
func NewTransport ¶ added in v0.7.0
NewTransport dials a transport using the --transport flag on the root command and the API key from config. Callers are responsible for calling Close on the returned transport.
func PrintError ¶ added in v0.7.0
PrintError logs err to logger with appropriate formatting.
Special cases:
- transport.ErrNoAPIKey → friendly "no key" message with auth hint
- *transport.RunwareError CodeAuth → "Authentication failed" with auth hint
- *transport.RunwareError other → re.Message, with docs URL as a "docs" field
For all other errors, err.Error() is used as the message.
func PrintErrorMsg ¶ added in v0.7.0
PrintErrorMsg logs a custom message to logger, appending the documentation URL from err as a "docs" field when err is a *transport.RunwareError with one. Use this when a command needs to surface a context-specific message for an error but continue executing (warning-style) rather than exit.
Types ¶
This section is empty.