output

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(data interface{}) error

Print outputs data in the configured format

func PrintError

func PrintError(format string, args ...interface{})

PrintError prints an error message (always shown)

func PrintInfo

func PrintInfo(format string, args ...interface{})

PrintInfo prints an info message (respects quiet mode)

func PrintResult

func PrintResult(success bool, message string, data interface{}) error

PrintResult prints an operation result

func PrintSuccess

func PrintSuccess(format string, args ...interface{})

PrintSuccess prints a success message (respects quiet mode)

func PrintWarning

func PrintWarning(format string, args ...interface{})

PrintWarning prints a warning message

func SetWriter

func SetWriter(w io.Writer)

SetWriter sets the output writer (for testing)

func Setup

func Setup(format string, pretty, quiet bool)

Setup initializes the output formatter

Types

type Format

type Format string

Format represents the output format

const (
	FormatJSON    Format = "json"
	FormatTable   Format = "table"
	FormatMinimal Format = "minimal"
	FormatTSV     Format = "tsv"
	FormatCSV     Format = "csv"
	FormatYAML    Format = "yaml"
)

type Result

type Result struct {
	Success bool        `json:"success"`
	Message string      `json:"message,omitempty"`
	Data    interface{} `json:"data,omitempty"`
}

Result wraps a successful operation result

Jump to

Keyboard shortcuts

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