output

package
v1.39.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultColorCode = 34

Maintain compatibility with the old color coding. 34 is the code for blue.

Variables

View Source
var (
	// LightRed can format text to be displayed to the terminal in light red.
	LightRed = Color{/* contains filtered or unexported fields */}
	// LightGreen can format text to be displayed to the terminal in light green.
	LightGreen = Color{/* contains filtered or unexported fields */}
	// LightYellow can format text to be displayed to the terminal in light yellow.
	LightYellow = Color{/* contains filtered or unexported fields */}
	// LightBlue can format text to be displayed to the terminal in light blue.
	LightBlue = Color{/* contains filtered or unexported fields */}
	// LightPurple can format text to be displayed to the terminal in light purple.
	LightPurple = Color{/* contains filtered or unexported fields */}
	// Red can format text to be displayed to the terminal in red.
	Red = Color{/* contains filtered or unexported fields */}
	// Green can format text to be displayed to the terminal in green.
	Green = Color{/* contains filtered or unexported fields */}
	// Yellow can format text to be displayed to the terminal in yellow.
	Yellow = Color{/* contains filtered or unexported fields */}
	// Blue can format text to be displayed to the terminal in blue.
	Blue = Color{/* contains filtered or unexported fields */}
	// Purple can format text to be displayed to the terminal in purple.
	Purple = Color{/* contains filtered or unexported fields */}
	// Cyan can format text to be displayed to the terminal in cyan.
	Cyan = Color{/* contains filtered or unexported fields */}
	// White can format text to be displayed to the terminal in white.
	White = Color{/* contains filtered or unexported fields */}
	// None uses ANSI escape codes to reset all formatting.
	None = Color{}

	// Default default output color for output from Skaffold to the user
	Default = Blue
)

Functions

func GetUnderlyingWriter added in v1.26.0

func GetUnderlyingWriter(out io.Writer) io.Writer

GetUnderlyingWriter returns the underlying writer if out is a colorableWriter

func GetWriter

func GetWriter(ctx context.Context, out io.Writer, defaultColor int, forceColors bool, timestamps bool) io.Writer

func IsColorable

func IsColorable(out io.Writer) bool

func IsStdout

func IsStdout(out io.Writer) bool

func NewColorWriter added in v1.26.0

func NewColorWriter(out io.Writer) io.Writer

func SetupColors

func SetupColors(ctx context.Context, out io.Writer, defaultColor int, forceColors bool) io.Writer

SetupColors conditionally wraps the input `Writer` with a color enabled `Writer`.

func WithEventContext added in v1.26.0

func WithEventContext(ctx context.Context, out io.Writer, phase constants.Phase, subtaskID string) (io.Writer, context.Context)

WithEventContext will return a new skaffoldWriter with the given parameters to be used for the event writer. If the passed io.Writer is not a skaffoldWriter, then it is simply returned.

Types

type Color

type Color struct {
	// contains filtered or unexported fields
}

Color can be used to format text so it can be printed to the terminal in color.

func (Color) Fprintf

func (c Color) Fprintf(out io.Writer, format string, a ...interface{})

Fprintf outputs the result to out.

func (Color) Fprintln

func (c Color) Fprintln(out io.Writer, a ...interface{})

Fprintln outputs the result to out, followed by a newline.

func (Color) Sprintf added in v1.27.0

func (c Color) Sprintf(format string, a ...interface{}) string

type ColorPicker added in v1.30.0

type ColorPicker interface {
	AddImage(string)
	Pick(string) Color
}

func NewColorPicker added in v1.30.0

func NewColorPicker() ColorPicker

NewColorPicker creates a new ColorPicker.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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