prompt

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitHandler

func ExitHandler()

func HandlePrompts

func HandlePrompts(prompts []Prompt) error

Types

type Handler

type Handler func()

func LogHandler

func LogHandler(f string) Handler

type Prompt

type Prompt interface {
	GetQuestion() string
}

type PromptResponse

type PromptResponse struct {
	Error  error
	Prompt Prompt
}

type RunePrompt

type RunePrompt interface {
	Prompt
	HandleRune(r rune) *PromptResponse
}

type YesNoQuestion

type YesNoQuestion struct {
	Question   string
	YesHandler Handler
	NoHandler  Handler
}

func (*YesNoQuestion) GetQuestion

func (q *YesNoQuestion) GetQuestion() string

func (*YesNoQuestion) HandleRune

func (q *YesNoQuestion) HandleRune(r rune) *PromptResponse

Jump to

Keyboard shortcuts

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