output

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package output handles functions relating to displaying the final output

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Display

func Display(data any) error

Display will decorate the output if possible. Otherwise, will print out the standard JSON.

Types

type EmptyStruct

type EmptyStruct struct{}

EmptyStruct is used when we wish to return an empty object.

type Printer added in v0.2.7

type Printer interface {
	DisplayNoColor(data any) error
	DisplayColor(data any) error
}

Printer is a content type agnostic interface for displaying data.

type UniPrinter added in v0.2.7

type UniPrinter struct {
	Colorful bool
	Printer  Printer
}

UniPrinter is a universal printer that can handle different output formats.

func NewUniPrinter added in v0.2.7

func NewUniPrinter(outputFormat string) *UniPrinter

NewUniPrinter creates a new UniPrinter based on the specified output format and optional functional options.

func (UniPrinter) Display added in v0.2.7

func (prt UniPrinter) Display(data any) error

Display prints the data using the configured printer and color settings.

Jump to

Keyboard shortcuts

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