prompt

package
v0.28.4 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSISuffix added in v0.25.0

func AddSISuffix(v float64, binary bool) (val float64, suffix string)

func Colorize added in v0.5.0

func Colorize(text string) string

func Owl added in v0.5.0

func Owl() string

Types

type ProgressBar added in v0.25.0

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

func NewProgressBar added in v0.25.0

func NewProgressBar(opts ...ProgressOption) *ProgressBar

func (*ProgressBar) Finish added in v0.25.0

func (p *ProgressBar) Finish()

func (*ProgressBar) Set added in v0.25.0

func (p *ProgressBar) Set(cur, max uint64)

func (*ProgressBar) Start added in v0.25.0

func (p *ProgressBar) Start()

func (*ProgressBar) Stop added in v0.25.0

func (p *ProgressBar) Stop()

func (*ProgressBar) Update added in v0.25.0

func (p *ProgressBar) Update(cur uint64)

type ProgressOption added in v0.25.0

type ProgressOption func(*ProgressBar)

func ProgressOptionAppendAdditionalInfo added in v0.25.0

func ProgressOptionAppendAdditionalInfo(f func() string) ProgressOption

func ProgressOptionBarSegments added in v0.25.0

func ProgressOptionBarSegments(segments int) ProgressOption

func ProgressOptionDescription added in v0.25.0

func ProgressOptionDescription(description string) ProgressOption

func ProgressOptionTickInterval added in v0.25.0

func ProgressOptionTickInterval(interval time.Duration) ProgressOption

func ProgressOptionWriter added in v0.25.0

func ProgressOptionWriter(w io.Writer) ProgressOption

type Prompt added in v0.12.0

type Prompt struct {
	Out io.Writer
}

func NewPrompt added in v0.12.0

func NewPrompt(out io.Writer) *Prompt

func (*Prompt) Ask added in v0.12.0

func (p *Prompt) Ask(question string) (string, error)

func (*Prompt) AskSecret added in v0.12.0

func (p *Prompt) AskSecret(question string) (string, error)

func (*Prompt) Confirm added in v0.12.0

func (p *Prompt) Confirm(text string) bool

func (*Prompt) Description added in v0.12.0

func (p *Prompt) Description(text string)

func (*Prompt) Error added in v0.12.0

func (p *Prompt) Error(text string)

func (*Prompt) Info added in v0.12.0

func (p *Prompt) Info(text string)

func (*Prompt) List added in v0.27.0

func (p *Prompt) List(items []string) string

func (*Prompt) Output added in v0.12.0

func (p *Prompt) Output(i ...interface{})

func (*Prompt) Print added in v0.12.0

func (p *Prompt) Print(i ...interface{})

func (*Prompt) Title added in v0.12.0

func (p *Prompt) Title(text string)

Jump to

Keyboard shortcuts

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