ui

package
v1.50.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionMessage

func ActionMessage(action *hcloud.Action) string

func ActionResourcesMessage

func ActionResourcesMessage(resources ...*hcloud.ActionResource) string

func FakeActionMessage

func FakeActionMessage(value string) string

FakeActionMessage returns the initial value with a unused color to grow the string size.

Because the ActionMessage function adds 1 color to the returned string. We add the same amount of colors to the FakeActionMessage, to make sure the padding is correct.

func StdoutIsTerminal

func StdoutIsTerminal() bool

StdoutIsTerminal returns whether the CLI is run in a terminal.

func TerminalWidth

func TerminalWidth() int

TerminalWidth returns the width of the terminal.

Types

type Progress

type Progress interface {
	Start()
	SetCurrent(value int)
	SetSuccess()
	SetError()
}

func NewProgress

func NewProgress(output io.Writer, message string, resources string) Progress

type ProgressGroup

type ProgressGroup interface {
	Add(message string, resources string) Progress
	Start() error
	Stop() error
}

func NewProgressGroup

func NewProgressGroup(output io.Writer) ProgressGroup

Jump to

Keyboard shortcuts

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