ui

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Standard = iota
	Debug
	Silent
)

Modes

Variables

This section is empty.

Functions

func ErrorWithContext

func ErrorWithContext(err error) error

Provides more context for errors when possible

func InitUI

func InitUI(mode int)

func InteractiveError

func InteractiveError() error

Types

type DefaultUI

type DefaultUI struct {
	StdOut          io.Writer
	StdErr          io.Writer
	DbgOut          io.Writer
	StdIn           io.Reader
	InteractiveMode bool
}
var (
	UI *DefaultUI
)

func (DefaultUI) Debug

func (u DefaultUI) Debug(text string)

func (DefaultUI) Debugf

func (u DefaultUI) Debugf(format string, a ...interface{})

func (DefaultUI) Error

func (u DefaultUI) Error(text string)

func (DefaultUI) Errorf

func (u DefaultUI) Errorf(format string, a ...interface{})

func (DefaultUI) Print

func (u DefaultUI) Print(text string)

func (DefaultUI) Printf

func (u DefaultUI) Printf(format string, a ...interface{})

func (DefaultUI) PromptInt

func (u DefaultUI) PromptInt(name, text string, result *int) error

Prompt user for int input

func (DefaultUI) PromptString

func (u DefaultUI) PromptString(name, text string, result *string) error

Prompt user for string input

func (DefaultUI) Scanf

func (u DefaultUI) Scanf(name, format string, result ...interface{}) error

func (DefaultUI) Scanln

func (u DefaultUI) Scanln(name string, result *string) error

Scans a line up to a newline and stores it in a string

Jump to

Keyboard shortcuts

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