Documentation ¶
Index ¶
- Variables
- func Center(str string) string
- func Indent(str string, indent int) string
- func InjectMockResponseToContext(ctx context.Context, mockValues []string) context.Context
- func Line(char string) string
- func Print(a ...interface{}) (int, error)
- func Printf(format string, a ...interface{}) (int, error)
- func Println(a ...interface{}) (int, error)
- func PrintlnWithoutIndent(a string) (int, error)
- func PromptBoolWithConfig(config *PromptBoolConfig) (bool, error)
- func PromptPasswordWithConfig(config *PromptPasswordConfig) (string, error)
- func PromptStringWithConfig(config *PromptStringConfig) (string, error)
- func Readline(config *ReadlineConfig) (string, error)
- func RemoveIndent(str string) string
- func SetOutputWriter(w io.Writer)
- type EOFError
- type InterruptError
- type ListPrompt
- type PromptBoolConfig
- type PromptPasswordConfig
- type PromptStringConfig
- type ReadlineConfig
- type ReadlineHandler
- type ValidateFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // IsInteractive must be set to print anything with Printer functions (Print, Printf,...). IsInteractive = isInteractive() // TerminalOutput define if the TerminalOutput = IsInteractive )
Functions ¶
func PrintlnWithoutIndent ¶
func PromptBoolWithConfig ¶
func PromptBoolWithConfig(config *PromptBoolConfig) (bool, error)
func PromptPasswordWithConfig ¶
func PromptPasswordWithConfig(config *PromptPasswordConfig) (string, error)
func PromptStringWithConfig ¶
func PromptStringWithConfig(config *PromptStringConfig) (string, error)
func Readline ¶
func Readline(config *ReadlineConfig) (string, error)
func RemoveIndent ¶
func SetOutputWriter ¶
SetOutputWriter set the output writer that will be used by both Printer functions (Print, Printf,...) and readline prompter. This should be called once from the bootstrap function.
Types ¶
type InterruptError ¶
type InterruptError struct{}
func (*InterruptError) Error ¶
func (e *InterruptError) Error() string
func (*InterruptError) MarshalHuman ¶
func (e *InterruptError) MarshalHuman() string
type ListPrompt ¶ added in v2.16.0
type ListPrompt struct { // Prompt that will be printed when showing the list Prompt string Choices []string // DefaultIndex is the element that will be selected when starting prompt DefaultIndex int // contains filtered or unexported fields }
func (*ListPrompt) Execute ¶ added in v2.16.0
func (m *ListPrompt) Execute(ctx context.Context) (int, error)
Execute start the prompt and return the selected index
func (*ListPrompt) Init ¶ added in v2.16.0
func (m *ListPrompt) Init() tea.Cmd
func (*ListPrompt) View ¶ added in v2.16.0
func (m *ListPrompt) View() string
type PromptBoolConfig ¶
type PromptPasswordConfig ¶
type PromptStringConfig ¶
type ReadlineConfig ¶
type ReadlineHandler ¶
type ReadlineHandler struct {
// contains filtered or unexported fields
}
func (*ReadlineHandler) SetPrompt ¶
func (h *ReadlineHandler) SetPrompt(prompt string)
type ValidateFunc ¶
func ValidateOrganizationID ¶
func ValidateOrganizationID() ValidateFunc
Click to show internal directories.
Click to hide internal directories.