output

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorMsg

func ErrorMsg(format string, args ...any)

func Hint

func Hint(format string, args ...any)

func IsTerminal

func IsTerminal() bool

func ProjectFields

func ProjectFields(data any, fields []string) any

func StripMetadata

func StripMetadata(data any) any

StripMetadata unwraps Amadeus response envelopes. Strips "meta" and "dictionaries" keys, returns "data" array if present.

func Success

func Success(format string, args ...any)

func Warn

func Warn(format string, args ...any)

func WithOptions

func WithOptions(ctx context.Context, opts Options) context.Context

func Write

func Write(ctx context.Context, data any) error

func WriteJSON

func WriteJSON(data any, pretty bool) error

func WritePlain

func WritePlain(headers []string, rows [][]string)

func WriteTable

func WriteTable(headers []string, rows [][]string)

Types

type Mode

type Mode int
const (
	ModeHuman Mode = iota
	ModeJSON
	ModePlain
)

type Options

type Options struct {
	Mode        Mode
	ResultsOnly bool
	Select      []string
	Pretty      bool
}

func GetOptions

func GetOptions(ctx context.Context) Options

Jump to

Keyboard shortcuts

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