termui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CheckMark string = "\u2714"
	XMark     string = "\u2715"
)

Variables

This section is empty.

Functions

func Ask

func Ask(question string) string

func BrightWhite

func BrightWhite(text string) string

func CliError

func CliError(ctx *cli.Context, err error) error

Wrap any error and add CLI context into error

func Colorize

func Colorize(text string, color Color) string

func Confirm

func Confirm(question string, deflt bool) bool

Confirm ask you question and return true if the answer is 'yes' or false if answer is 'no'. You need to set also default value.

func ConfirmApply

func ConfirmApply() bool

func Green

func Green(text string) string

func Grey

func Grey(text string) string
func Hyperlink(name, url string) string

Print Hyperlink via OSC 8 ansi sequence. The syntax is: 'OSC 8 ; params ; url ST text OSC 8 ; ; ST' for more info see https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

func Info

func Info(text string, a ...interface{})

Info is used for regular messages they're print to terminal

func Magenta

func Magenta(text string) string

func PrintRepositories

func PrintRepositories(repos []string)

func PrintRepository

func PrintRepository(repository string, tags []string, params map[string]string)

func Red

func Red(text string) string

func Select

func Select(question string, options ...string) string

func ShowError

func ShowError(err error)

ShowError is responsible for printing all errors. Errors shouldn't be printed directly but returned to main function

Types

type Color

type Color string
const (
	RedColor     Color = "31"
	GreenColor   Color = "32"
	YellowColor  Color = "33"
	BlueColor    Color = "34"
	MagentaColor Color = "35"
	CyanColor    Color = "36"
	GreyColor    Color = "90"

	BrightWhiteColor Color = "37;1"
)

type Listener

type Listener struct {
}

func (*Listener) OnEvent

func (l *Listener) OnEvent(ev api.Event)

Jump to

Keyboard shortcuts

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