format

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FormatFlag string
)

Functions

func BlockStdOut

func BlockStdOut()

func NewFormatter

func NewFormatter(data interface{}) *outputFormatter

func RegisterFormatFlag

func RegisterFormatFlag(cmd *cobra.Command)

func UnblockStdOut

func UnblockStdOut()

Types

type Formatter

type Formatter interface {
	Format(data interface{}) (string, error)
}

type JSONFormatter

type JSONFormatter struct{}

func (JSONFormatter) Format

func (f JSONFormatter) Format(data interface{}) (string, error)

type YAMLFormatter

type YAMLFormatter struct{}

func (YAMLFormatter) Format

func (f YAMLFormatter) Format(data interface{}) (string, error)

Jump to

Keyboard shortcuts

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