prompt

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStubber

func NewStubber() (*Stubber, *FakePrompt)

NewStubber creates a new *Stubber which can stub out calls to returned *FakePrompt's AskOne method.

Types

type FakePrompt

type FakePrompt struct {
	mock.Mock
}

FakePrompt is a mock implementation of a Prompt.

func (*FakePrompt) AskOne

func (f *FakePrompt) AskOne(p survey.Prompt, response interface{}, opts ...survey.AskOpt) error

AskOne implements Prompt.

type Prompt

type Prompt interface {
	AskOne(p survey.Prompt, response interface{}, opts ...survey.AskOpt) error
}

Prompt can be used to request user input.

func New

func New() Prompt

New returns a prompt which just directly calls survey.AskOne.

type Stubber

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

Stubber can stub prompts.

func (*Stubber) StubMany

func (s *Stubber) StubMany(values ...interface{})

StubOne makes the next prompts return the provided values.

func (*Stubber) StubOne

func (s *Stubber) StubOne(value interface{})

StubOne makes the next prompt return value.

func (*Stubber) StubOneDefault

func (s *Stubber) StubOneDefault()

StubOneDefault makes the next prompt return its default value.

func (*Stubber) StubOneError

func (s *Stubber) StubOneError(err error)

StubOneError makes the next prompt return err.

Jump to

Keyboard shortcuts

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