Documentation ¶
Overview ¶
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ERROR_PREFIX = color.New(color.Bold, color.FgRed, color.ReverseVideo).Sprint(" ERROR ")
var InfoPrefix = color.New(color.Bold, color.FgWhite, color.ReverseVideo).Sprint(" INFO ")
InfoPrefix is a colored string for warning level log messages
var IsCI = !IsTTY || ci.IsCi()
IsCI is true when we appear to be running in a non-interactive context.
var IsTTY = isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())
IsTTY is true when stdout appears to be a tty
var WARNING_PREFIX = color.New(color.Bold, color.FgYellow, color.ReverseVideo).Sprint(" WARNING ")
Functions ¶
func Rainbow ¶
Rainbow function returns a formated colorized string ready to print it to the shell/terminal
Adapted from go-rainbow Copyright (c) 2017 Raphael Amorim Source: https://github.com/raphamorim/go-rainbow SPDX-License-Identifier: MIT
Types ¶
type BasicUI ¶
BasicUI is an implementation of Ui that just outputs to the given writer. This UI is not threadsafe by default, but you can wrap it in a ConcurrentUi to make it safe.
Inlined from cli.Ui to fuse newlines to lines being logged. This is probably not the optimal way to do it, but it works for now.
type BasicUIFactory ¶
type BasicUIFactory struct { }
BasicUIFactory provides a method for creating a cli.BasicUi from input, output and error IOs
type ColoredUIFactory ¶
ColoredUIFactory provides a method for creating a cli.ColoredUi from input, output and error IOs
type ConcurrentUIFactory ¶
type ConcurrentUIFactory struct {
Base Factory
}
ConcurrentUIFactory provides a method for creating a cli.ConcurrentUi from input, output and error IOs
type Factory ¶
Factory provides an interface for creating cli.Ui instances from input, output and error IOs
type PrefixedUIFactory ¶
type PrefixedUIFactory struct { Base Factory AskPrefix string AskSecretPrefix string OutputPrefix string InfoPrefix string ErrorPrefix string WarnPrefix string }
PrefixedUIFactory provides a method for creating a cli.PrefixedUi from input, output and error IOs
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner represents an indicator that an asynchronous operation is taking place.
For short operations, less than 4 seconds, display only the spinner with the Start and Stop methods. For longer operations, display intermediate progress events using the Events method.
func NewSpinner ¶
NewSpinner returns a spinner that outputs to w.