prompt

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(w io.Writer, label, msg string) (string, error)

Confirm prompts the user for confirmation with the given label. msg is expected to be a simple string such as "canceled" or "skipped" and will not be handled as an ignoresync error.

func NewPromptError

func NewPromptError(err error) error

NewPromptError constructs a prompt error wrapping optional underlying error.

func Secret

func Secret(w io.Writer, label string, validator func(string) error) (string, error)

Secret prompts the user to enter a secret value with the given label and validation function.

Types

type Error

type Error struct {
	Kind ErrorKind
	Err  error
}

Error represents an error that occurred in the prompt.

func (*Error) Error

func (e *Error) Error() string

Error returns the string representation of the prompt error.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns the underlying error of the prompt error.

type ErrorKind

type ErrorKind int

ErrorKind represents the kind of error that occurred in the operator.

const (
	// ErrorKindNone indicates no error.
	ErrorKindNone ErrorKind = iota

	// ErrorKindPrompt indicates error in interaction.
	ErrorKindPrompt
)

func (ErrorKind) String

func (k ErrorKind) String() string

String returns the string representation of the ErrorKind.

Jump to

Keyboard shortcuts

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