prompt

package
v0.0.0-...-bc2bdbf Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(fieldName string, defval interface{}) func() interface{}

New returns a prompt closure when executed asks for user input once and caches it for further invocations and has a default value that returns result.

Types

type Chain

type Chain struct {
	Prompts []Interface
}

type Interface

type Interface interface {
	// PromptMessage returns a proper prompt message for the given field with the given default value.
	PromptMessage(string) string
	EvaluateChoice(string) (interface{}, error)
}

func Func

func Func(defval interface{}) Interface

TODO add deep pretty printer TODO handle TOML

Jump to

Keyboard shortcuts

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