console

package
v0.0.0-...-127b1e4 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: OSL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExitSuccess code represents exit when success
	ExitSuccess = iota
	// ExitError code represents exit when error occur
	ExitError
	// ExitBadConnection code represents exit when bad connection
	ExitBadConnection
	// ExitInvalidInput code represents for txn, watch command
	ExitInvalidInput
	// ExitBadFeature code represents provided a valid flag with an unsupported value
	ExitBadFeature
	// ExitInterrupted code represents exit the code get interrupted
	ExitInterrupted
	// ExitIO code represents exit when io error
	ExitIO
	// ExitBadArgs code represents  exit when arguments are not right
	ExitBadArgs = 128
)

Variables

View Source
var DefaultLoadWriter io.Writer = color.Output
View Source
var Logger *logrus.Logger
View Source
var TableLogger *logrus.Logger

Functions

func ExitWithError

func ExitWithError(code int, err error)

ExitWithError Exit Command with error

func InitLogger

func InitLogger()

func StartLoading

func StartLoading(format string, args ...interface{})

func StopLoading

func StopLoading()

func WriteTable

func WriteTable(headers []string, data [][]string)

Types

type Prompt

type Prompt interface {
	RequestPassphrase() string
	RequestString(label string, validate promptui.ValidateFunc) string
	RequestHiddenString(label string, validate promptui.ValidateFunc) string
	RequestConfirmation(label string) bool
	RequestChoice(label string, choices []string, opt RequestChoiceOptions) int
}

func NewPrompt

func NewPrompt() Prompt

type RequestChoiceOptions

type RequestChoiceOptions struct {
	ActiveChoice      string
	ActiveChoiceLabel string
}

Jump to

Keyboard shortcuts

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