output

package
v2.7.4-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package output provides structured output for *cobra.Command. Writing JSON to stdout is enable by setting the --output=json flag.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetJSONStderr added in v2.6.5

func SetJSONStderr(ctx context.Context)

func SetJSONStdout added in v2.6.5

func SetJSONStdout(ctx context.Context)

func Structured

func Structured(ctx context.Context) (stdout, stderr io.Writer)

func WantsJSONOutput added in v2.6.5

func WantsJSONOutput(flags *pflag.FlagSet) bool

func WithStructure

func WithStructure(ctx context.Context, cmd *cobra.Command) context.Context

Types

type StructuredStreamer added in v2.6.5

type StructuredStreamer interface {
	StructuredStream(v any, err error)
}

Jump to

Keyboard shortcuts

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