ui

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Template

func Template(destination io.Writer, name, text string, data interface{}) error

Types

type Level

type Level string

Level specifies the level of output that commands should print

const (
	LevelVerbose Level = "Verbose"
	LevelInfo    Level = "Info"
	LevelError   Level = "Error"
	LevelSilent  Level = "Silent"
)

LevelVerbose includes all output

func (Level) OutputIsIncluded

func (levelA Level) OutputIsIncluded(levelB Level) bool

OutputIsIncluded returns true if levelA specifies that levelB should be included for output

type UI

type UI struct {
	EffectiveLevel Level
	DefaultLevel   Level
	UserLevel      Level
	UserLevelSet   bool
	Out            io.Writer
	Err            io.Writer
}

UI is the abstraction of handling terminal output for shuttle

func Create

func Create(out, err io.Writer) *UI

Create doc

func (*UI) EmphasizeInfoln

func (ui *UI) EmphasizeInfoln(format string, args ...interface{})

func (*UI) Errorln

func (ui *UI) Errorln(format string, args ...interface{})

Errorln doc

func (*UI) Infoln

func (ui *UI) Infoln(format string, args ...interface{})

Infoln prints a formatted info message line.

func (*UI) Output added in v0.21.0

func (ui *UI) Output(format string, args ...interface{})

Output.

func (*UI) SetContext

func (ui *UI) SetContext(level Level) *UI

SetContext doc

func (*UI) SetUserLevel

func (ui *UI) SetUserLevel(level Level) *UI

SetUserLevel doc

func (*UI) Titleln

func (ui *UI) Titleln(format string, args ...interface{})

Titleln doc

func (*UI) Verboseln

func (ui *UI) Verboseln(format string, args ...interface{})

Verboseln prints a formatted verbose message line.

Jump to

Keyboard shortcuts

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