dialog_ui

package
v0.0.0-...-3a64f8a Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DialogExit     = "exit status 1"
	DialogMoveBack = "exit status 2"
	DialogNext     = "exit status 3"
)
View Source
const (
	Success      = "Success"
	Error        = "Failure"
	Warning      = "Warning"
	Notification = "Notification"
	None         = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DialogUi

type DialogUi struct {
	*Dialog
	Pb *Pb
}

func NewDialogUi

func NewDialogUi() *DialogUi

func (*DialogUi) GetFromInput

func (ui *DialogUi) GetFromInput(title, defaultInput, helpButtonLabel, extraButtonLabel string) (string, error)

GetFromInput uses a dialog session for reading from stdin Returns user input

func (*DialogUi) GetIpFromInput

func (ui *DialogUi) GetIpFromInput(title, helpButtonLabel, extraButtonLabel string) (string, error)

GetIpFromInput uses a dialog session for reading IP from user input Returns host IP (remote or local)

func (*DialogUi) GetPasswordFromInput

func (ui *DialogUi) GetPasswordFromInput(host, user, helpButtonLabel, extraButtonLabel string, confirm bool) (passwd1 string, err error)

GetPasswordFromInput uses a dialog session for reading user password from user input Returns password string

func (*DialogUi) GetPathToDirFromInput

func (ui *DialogUi) GetPathToDirFromInput(title, defaultDir, helpButtonLabel, extraButtonLabel string) (string, error)

GetPathToDirFromInput uses a dialog session for getting path to a directory to upload

func (*DialogUi) GetPathToFileFromInput

func (ui *DialogUi) GetPathToFileFromInput(title, helpButtonLabel, extraButtonLabel string) (string, error)

GetPathToFileFromInput uses a dialog session for getting path to a file

func (*DialogUi) Output

func (ui *DialogUi) Output(ntype string, msgs ...string)

Output gets dialog session , height/width and slice of strings Prints out appropriate message

func (*DialogUi) Progress

func (ui *DialogUi) Progress(title, pbMsg string, duration time.Duration, step int, done chan error) error

Progress implements a progress bar Returns error or nil

func (*DialogUi) Wait

func (ui *DialogUi) Wait(msg string, pause, timeOut time.Duration, done chan error) error

Wait communicates with a progress bar while a given function is executed Returns error or nil

type Pb

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

func (*Pb) DecreaseStep

func (p *Pb) DecreaseStep(s int)

func (*Pb) IncreaseSleep

func (p *Pb) IncreaseSleep(s string) error

func (*Pb) IncreaseStep

func (p *Pb) IncreaseStep(s int)

func (*Pb) SetSleep

func (p *Pb) SetSleep(s string) (err error)

func (*Pb) SetStep

func (p *Pb) SetStep(s int)

func (*Pb) Sleep

func (p *Pb) Sleep() time.Duration

func (*Pb) Step

func (p *Pb) Step() int

Jump to

Keyboard shortcuts

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