ui

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Failed statusCategory = iota
	Complete
	InProgress
	Pending
	Cancelled
)

Variables

View Source
var StatusColour = map[statusCategory]func(...interface{}) string{
	Pending:    console.Plain,
	InProgress: console.Blue,
	Failed:     console.Red,
	Complete:   console.Green,
	Cancelled:  console.Grey,
}

Functions

func Colourise

func Colourise(msg, status string) string

Colourise wraps a message in an appropriate colour based on the accompanying status string

func ColouriseDiff

func ColouriseDiff(d diff.Diff, longFormat bool) string

ColouriseDiff wraps a diff object in nice colours

func ColouriseStatus

func ColouriseStatus(status string) string

ColouriseStatus wraps a status code in an appropriate colour

func Errorf

func Errorf(err error, message string, parts ...interface{}) error

Errorf wraps an error, extracting the AWS API error if it exists

func Indent

func Indent(prefix string, in string) string

Indent adds prefix to every line of in

Types

type StatusRep added in v1.4.0

type StatusRep struct {
	Category statusCategory
	Symbol   string
}

func MapStatus added in v1.4.0

func MapStatus(status string) *StatusRep

func (*StatusRep) String added in v1.4.0

func (s *StatusRep) String() string

Jump to

Keyboard shortcuts

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