fake

package
v3.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeInput

type FakeInput struct {
	// Values the values to return indexed by the message
	Values map[string]string

	// OrderedValues are used if there is not a value indexed by message
	OrderedValues []string

	// Counter the number of fields that have been requested so far
	Counter int
}

FakeInput provide a fake provider for testing

func (*FakeInput) Confirm

func (f *FakeInput) Confirm(message string, defaultValue bool, help string) (bool, error)

func (*FakeInput) PickNameWithDefault

func (f *FakeInput) PickNameWithDefault(names []string, message string, defaultValue string, help string) (string, error)

PickNameWithDefault picks a value

func (*FakeInput) PickPassword

func (f *FakeInput) PickPassword(message string, help string) (string, error)

PickPassword gets a password (via hidden input) from a user's free-form input

func (*FakeInput) PickValidValue

func (f *FakeInput) PickValidValue(message string, defaultValue string, validator func(val interface{}) error, help string) (string, error)

PickValidValue gets an answer to a prompt from a user's free-form input with a given validator

func (*FakeInput) PickValue

func (f *FakeInput) PickValue(message string, defaultValue string, required bool, help string) (string, error)

PickValue picks a value

func (*FakeInput) SelectNames

func (f *FakeInput) SelectNames(names []string, message string, selectAll bool, help string) ([]string, error)

func (*FakeInput) SelectNamesWithFilter

func (f *FakeInput) SelectNamesWithFilter(names []string, message string, selectAll bool, filter string, help string) ([]string, error)

Jump to

Keyboard shortcuts

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