Documentation
¶
Overview ¶
Package output handles formatting and writing wazuh-cli responses in JSON, Markdown, or raw formats.
Index ¶
Constants ¶
View Source
const ( FormatJSON = "json" FormatMarkdown = "markdown" FormatRaw = "raw" )
Format constants.
Variables ¶
This section is empty.
Functions ¶
func ExitCode ¶
ExitCode translates an error to a wazuh-cli exit code.
0 = success 1 = client error (bad flags, network, config) 2 = API error 3 = auth error 4 = permission denied
Types ¶
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter writes structured data to an output stream.
func (*Formatter) Write ¶
Write outputs data to stdout in the configured format. data should be json.RawMessage or any JSON-serializable value.
func (*Formatter) WriteError ¶
WriteError outputs a machine-readable error to stdout (JSON) or stderr (other formats).
Click to show internal directories.
Click to hide internal directories.