out

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package out provides a mechanism for sending localized, stylized output to the console.

Index

Constants

View Source
const MaxLogEntries = 3

MaxLogEntries controls the number of log entries to show for each source

Variables

View Source
var (

	// OverrideEnv is the environment variable used to override color/emoji usage
	OverrideEnv = "MINIKUBE_IN_STYLE"
	// JSON is whether or not we should output stdout in JSON format. Set using SetJSON()
	JSON = false
)

Functions

func ApplyTemplateFormatting added in v1.10.0

func ApplyTemplateFormatting(style StyleEnum, useColor bool, format string, a ...V) string

ApplyTemplateFormatting applies formatting to the provided template

func DisplayError added in v1.10.0

func DisplayError(msg string, err error)

DisplayError prints the error and displays the standard minikube error messaging

func Err

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

Err writes a basic formatted string to stderr

func ErrLn

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

ErrLn writes a basic formatted string with a newline to stderr

func ErrT

func ErrT(style StyleEnum, format string, a ...V)

ErrT writes a stylized and templated error message to stderr

func FailureT

func FailureT(format string, a ...V)

FailureT is a shortcut for writing a templated failure message to stderr

func FatalT

func FatalT(format string, a ...V)

FatalT is a shortcut for writing a templated fatal message to stderr

func Infof added in v1.12.1

func Infof(format string, a ...V)

Infof is used for informational logs (options, env variables, etc)

func Ln

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

Ln writes a basic formatted string with a newline to stdout

func LogEntries added in v1.10.0

func LogEntries(msg string, err error, entries map[string][]string)

LogEntries outputs an error along with any important log entries.

func SetErrFile

func SetErrFile(w fdWriter)

SetErrFile configures which writer error output goes to.

func SetJSON added in v1.12.1

func SetJSON(j bool)

SetJSON configures printing to STDOUT in JSON

func SetOutFile

func SetOutFile(w fdWriter)

SetOutFile configures which writer standard output goes to.

func String

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

String writes a basic formatted string to stdout

func SuccessT

func SuccessT(format string, a ...V)

SuccessT is a shortcut for writing a templated success message to stdout

func T

func T(style StyleEnum, format string, a ...V)

T writes a stylized and templated message to stdout

func WarningT

func WarningT(format string, a ...V)

WarningT is a shortcut for writing a templated warning message to stderr

Types

type StyleEnum

type StyleEnum int

StyleEnum is an enumeration of Style

const (
	AddonDisable StyleEnum = iota
	AddonEnable
	Caching
	Celebrate
	Celebration
	Check
	Command
	Conflict
	Confused
	Connectivity
	Containerd
	ContainerRuntime
	Copying
	CRIO
	Deleted
	DeletingHost
	Docker
	Documentation
	DryRun
	Embarrassed
	Empty
	Enabling
	FailureType
	FatalType
	FileDownload
	Fileserver
	Happy
	HealthCheck
	Internet
	ISODownload
	Issue
	Issues
	Kubectl
	Launch
	LogEntry
	Meh
	Mounting
	MountOptions
	New
	Notice
	Option
	Pause
	Permissions
	Provisioner
	Provisioning
	Pulling
	Ready
	Resetting
	Restarting
	Running
	Sad
	Shrug
	Shutdown
	Sparkle
	StartingNone
	StartingVM
	Stopped
	Stopping
	SuccessType
	ThumbsDown
	ThumbsUp
	Tip
	Unmount
	Unpause
	URL
	Usage
	Verifying
	VerifyingNoLine
	Waiting
	WaitingPods
	Warning
	Workaround
	CNI
)

All the Style constants available

type V

type V map[string]interface{}

V is a convenience wrapper for templating, it represents the variable key/value pair.

Directories

Path Synopsis
Package register contains all the logic to print out `minikube start` in JSON
Package register contains all the logic to print out `minikube start` in JSON

Jump to

Keyboard shortcuts

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