prompt

package
v0.0.0-...-99a2c5e Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package prompt provides functionality for filling struct from user input which the user is asked for on the command line.

Index

Constants

View Source
const (
	TagValueSkip     = "-"
	TagValueRequired = "required"
	TagValueValidate = "validate"
	TagValueName     = "name"
	TagValueMask     = "mask"
)

Available struct tag values for "prompt".

Variables

This section is empty.

Functions

This section is empty.

Types

type Prompter

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

A Prompter prompts the user for input.

func New

func New() *Prompter

New creates a new Prompter.

func NewWithValidators

func NewWithValidators(validators map[string]ValidatorFunc) *Prompter

NewWithValidators creates a new Prompter with the given validator functions.

func (*Prompter) Run

func (p *Prompter) Run(v interface{}) error

Run executes the Prompter for the given struct.

type ValidatorFunc

type ValidatorFunc = promptui.ValidateFunc

ValidatorFunc validates prompt input.

Jump to

Keyboard shortcuts

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