printer

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OutputFormatJson = "json"
	OutputFormatYaml = "yaml"
	OutputFormatYml  = "yml"
)

Variables

View Source
var (
	FaintColor   = color.New(color.Faint)
	InfoColor    = color.New(color.FgCyan)
	SuccessColor = color.New(color.FgGreen)
	WarnColor    = color.New(color.FgYellow)
	ErrorColor   = color.New(color.FgRed)
	BoldColor    = color.New(color.Bold)
)
View Source
var (
	DiffAdditionColor    = color.New(color.FgGreen)
	DiffSubtractionColor = color.New(color.FgRed)
	DiffUnchangedColor   = color.New()
	DiffContextToShow    = 4
)

Functions

func ColorConditionStatus added in v0.8.0

func ColorConditionStatus(condStatus string) string

func ConditionStatus

func ConditionStatus(cond *metav1.Condition) string

func EmptyString

func EmptyString(str string) string

func ExportResource

func ExportResource(obj Object, format OutputFormat, scheme *runtime.Scheme) (string, error)

func FindCondition

func FindCondition(conditions []metav1.Condition, ct string) *metav1.Condition

func Labels

func Labels(labelMap map[string]string) string

func OutputResource

func OutputResource(obj Object, format OutputFormat, scheme *runtime.Scheme) (string, error)

func OutputResources added in v0.6.0

func OutputResources(objList []Object, format OutputFormat, scheme *runtime.Scheme) (string, error)

func ResourceDiff

func ResourceDiff(left, right Object, scheme *runtime.Scheme) (string, bool, error)

ResourceDiff returns the results of diffing left and right as an pretty printed string. It will display all the lines of both the sequences that are being compared. When the left is different from right it will prepend a " - |" before the line. When the right is different from left it will prepend a " + |" before the line. When the right and left are equal it will prepend a " |" before the line.

func ResourceStatus

func ResourceStatus(name string, condition *metav1.Condition) string

func Sboldf added in v0.7.0

func Sboldf(format string, a ...interface{}) string

func Serrorf

func Serrorf(format string, a ...interface{}) string

func Sfaintf

func Sfaintf(format string, a ...interface{}) string

func Sinfof

func Sinfof(format string, a ...interface{}) string

func SortByNamespaceAndName

func SortByNamespaceAndName(s interface{})

func Ssuccessf

func Ssuccessf(format string, a ...interface{}) string

func Swarnf

func Swarnf(format string, a ...interface{}) string

func TimestampSince

func TimestampSince(timestamp metav1.Time, now time.Time) string

func WithSurveyStdio

func WithSurveyStdio(stdin io.Reader, stdout, stderr io.Writer) survey.AskOpt

Types

type Object

type OutputFormat

type OutputFormat string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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