types

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorWithAlternatives

type ErrorWithAlternatives interface {
	error
	Alternatives() []string
}

type QuestionInterface

type QuestionInterface[T any] interface {
	GetQuestion() string
	Default() T
	Normalizer() QuestionNormalizer[T]
	Validator() QuestionValidator[T]
	MaxAttempts() int
	IsTrimmable() bool
	IsMultiline() bool
}

type QuestionNormalizer

type QuestionNormalizer[T any] func(string) T

type QuestionValidator

type QuestionValidator[T any] func(T) (T, error)

type StyleInterface

type StyleInterface interface {
	Title(message string)
	Section(message string)
	Listing(elements []string, prefix string)
	Text(messages []string)
	Success(messages []string)
	Err(messages []string)
	Warning(messages []string)
	Info(messages []string)
	Note(messages []string)
	Caution(messages []string)
	Table(headers []string, rows map[string]string)
	Ask(questions string, defaultValue string, validator func(string) bool) string
	AskHidden(question string, validator func(string) bool) string
	Confirm(question string, defaultValue bool) bool
	Choice(question string, choices map[string]string, defaultValue string) string
	NewLine(count int)
	ProgressStart(max uint)
	ProgressAdvance(step uint)
	ProgressFinish()
	Box(title string, body string, footer string, color string, info string)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳