prompt

package
Version: v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Prompt provides user input handling.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNack = errors.New("negative ack")
)
View Source
var InputBufferSize int = 1000

Functions

This section is empty.

Types

type ConfirmationPrompt

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

func NewConfirmationPrompt

func NewConfirmationPrompt(prompt, word string, in io.Reader, out io.Writer) *ConfirmationPrompt

func (*ConfirmationPrompt) Prompt

func (p *ConfirmationPrompt) Prompt() error

type GuidedPrompt

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

func NewGuidedPrompt

func NewGuidedPrompt(items []Item, in io.Reader, out io.Writer) *GuidedPrompt

func (*GuidedPrompt) Prompt

func (p *GuidedPrompt) Prompt() error

type Item

type Item struct {
	Name      string
	Desc      string
	Required  bool
	Skip      bool
	IsDefault bool
	Default   string
	Value     string
	Valid     []string
	Validator func(string) error
}

type Prompter

type Prompter interface {
	Prompt() error
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL