format

package
v1.1.37 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSupported

func IsSupported(formatName string) bool

IsSupported returns true if the given format is supported

func SupportedFormats

func SupportedFormats() []string

SupportedFormats returns the names of supported formats as strings

Types

type Format

type Format int

Format is an enum type representing different output formats

const (
	// Yaml format prints output in YAML
	Yaml Format = iota
	// Json format prints output in JSON
	Json
	// None format causes output to be suppressed
	None
	// PrettyYaml format prints output in colored YAML
	PrettyYaml
)

func (Format) Format

func (f Format) Format(data interface{}, w io.Writer) error

Format will write formatted data to the given writer

func (*Format) FromString

func (f *Format) FromString(value string) error

FromString will set the receiver's value to the one denoted by the given string

func (Format) String

func (f Format) String() string

String returns a string representation of this format

Jump to

Keyboard shortcuts

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