cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPromptCommandIsNotKnown = errors.New("prompt command is not known")
View Source
var FailureColor = color.New(color.FgRed, color.Bold)
View Source
var NeutralColor = color.New(color.FgCyan)
View Source
var NoColor = color.New()
View Source
var SuccessColor = color.New(color.FgGreen)
View Source
var WarnColor = color.New(color.FgYellow)

Functions

func Ask

func Ask(query string, args ...interface{}) (string, error)

func ColorPrint

func ColorPrint(col *color.Color, msg string)

func Error

func Error(msg string)

func Errorf

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

func Info

func Info(msg string)

func Infof

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

func Print

func Print(msg string)

func Prompt

func Prompt(commands []PromptCmd) error

func Warn

func Warn(msg string)

func Warnf

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

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func PrefixedLogger

func PrefixedLogger(prefix string) *Logger

func (*Logger) ColorPrint

func (l *Logger) ColorPrint(col *color.Color, msg string)

func (*Logger) Error

func (l *Logger) Error(msg string)

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(msg string)

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

func (*Logger) Print

func (l *Logger) Print(msg string)

func (*Logger) Warn

func (l *Logger) Warn(msg string)

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...interface{})

type PromptCmd

type PromptCmd struct {
	TriggerInputs []string
	Description   string
	Action        func()
}

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table represents data as a table

func NewTable

func NewTable() *Table

NewTable creates a new table

func (*Table) Cell

func (t *Table) Cell(s string) *Table

Cell adds cell

func (*Table) ColorizedCell

func (t *Table) ColorizedCell(s string, colorDef *color.Color) *Table

func (*Table) Header

func (t *Table) Header() *Table

Header adds a header to table

func (*Table) NoBorder

func (t *Table) NoBorder() *Table

func (*Table) Render

func (t *Table) Render() string

Render renders the table

func (*Table) Row

func (t *Table) Row() *Table

Row switches table to a new raw. All the Cell calls will cause new cells to be added to a new row

Jump to

Keyboard shortcuts

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