prompt

package
v0.0.0-...-ea67977 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 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 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)
}

Interface for prompts.

func Func

func Func(defval interface{}) Interface

Func creates template functions for prompts. 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