mock

package
v0.0.0-...-7426b64 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock struct {
	tmock.Mock
}

Mock the struct to mock the Prompt struct

func Init

func Init() *Mock

Init an object

func (*Mock) Close

func (m *Mock) Close()

Close it

func (*Mock) Confirm

func (m *Mock) Confirm(title, message string, defaultChoice *bool) (bool, error)

Confirm prompts user for yes or no response.

func (*Mock) Input

func (m *Mock) Input(title, message string, defaultResponse *string, flags ...prompt.ValidatorFlag) (string, error)

Input prompts the user for input

func (*Mock) InputAndValidate

func (m *Mock) InputAndValidate(title, message string, defaultResponse *string, validator prompt.ValidatorFunc, flags ...prompt.ValidatorFlag) (response string, err error)

InputAndValidate prompts the user for input witha customer validator and validation flags

func (*Mock) InputSecret

func (m *Mock) InputSecret(title, message string, flags ...prompt.ValidatorFlag) (response string, err error)

InputSecret prompts the user for input and obfuscates the text in stdout. Will fail if empty.

func (*Mock) IsInteractive

func (m *Mock) IsInteractive() bool

func (*Mock) OnMethod

func (m *Mock) OnMethod(methodName string) *tmock.Call

OnMethod behaves like mock.On but disregards whether arguments match or not

func (*Mock) Select

func (m *Mock) Select(title, message string, choices []string, defaultChoice *string) (string, error)

Select prompts the user to select one entry from multiple choices

Jump to

Keyboard shortcuts

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