prompt

package
v0.0.0-...-005fdad Latest Latest
Warning

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

Go to latest
Published: May 10, 2017 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkbox

type Checkbox struct {
	Question      string
	Choices       []*Choice
	CheckedChoice []*Choice
	// contains filtered or unexported fields
}

func NewCheckbox

func NewCheckbox() *Checkbox

func (*Checkbox) RenderChoices

func (s *Checkbox) RenderChoices(currentPosition int)

func (*Checkbox) RenderHeader

func (s *Checkbox) RenderHeader()

func (*Checkbox) Run

func (s *Checkbox) Run() ([]CheckboxResult, error)

type CheckboxResult

type CheckboxResult struct {
	ID    int
	Label string
}

type Choice

type Choice struct {
	ID          int
	Label       string
	Type        string
	Selected    bool
	IsSeparator bool
	// contains filtered or unexported fields
}

type Confirm

type Confirm struct {
	Question string
	Default  string
}

func NewConfirm

func NewConfirm() *Confirm

func (*Confirm) Run

func (confirm *Confirm) Run() bool

type Input

type Input struct {
	Question           string
	Default            string
	MaximumNumberOfTry int
	ErrorMessage       func(string) string
	Validation         func(string) bool
	// contains filtered or unexported fields
}

func NewInput

func NewInput() *Input

func (*Input) Run

func (input *Input) Run() (string, error)

type Password

type Password struct {
	*Input
}

func NewPassword

func NewPassword() *Password

func (*Password) Run

func (password *Password) Run() (string, error)

type Select

type Select struct {
	Question       string
	Choices        []*Choice
	SelectedChoice Choice
	// contains filtered or unexported fields
}

func NewSelect

func NewSelect() *Select

func (*Select) RenderChoices

func (s *Select) RenderChoices(currentPosition int)

func (*Select) RenderHeader

func (s *Select) RenderHeader()

func (*Select) Run

func (s *Select) Run() (SelectResult, error)

type SelectResult

type SelectResult struct {
	ID    int
	Label string
}

Jump to

Keyboard shortcuts

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