Documentation
¶
Overview ¶
Package installerui contains neutral terminal selection and confirmation primitives. Hosts provide product-specific options and interpret the result.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidRequest = errors.New("invalid terminal request") ErrInvalidSelection = errors.New("invalid terminal selection") )
var ( ErrCancelled = errors.New("installer ui cancelled") //nolint:misspell // Preserve the public sentinel's existing error text. )
Functions ¶
This section is empty.
Types ¶
type ConfirmRequest ¶
type Confirmation ¶
type MultiSelectRequest ¶
type MultiSelectRequest struct {
SelectRequest
MinSelected int
}
type SelectRequest ¶
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal owns readers only during a call, never the borrowed descriptors. All calls, including methods on PlainUI, must be sequential on the same TTY. Supply a signal/deadline-aware context to each prompt.
func NewTerminal ¶
func NewTerminal(cfg TerminalConfig) (*Terminal, error)
func (*Terminal) Confirm ¶
func (t *Terminal) Confirm(ctx context.Context, req ConfirmRequest) (result Confirmation, err error)
func (*Terminal) Mode ¶
func (t *Terminal) Mode() TerminalMode
func (*Terminal) PlainUI ¶
PlainUI preserves the legacy line API and grammar for action/unit menus. Its cancellable reader joins before return; no reader lives between calls. UI.Confirm has legacy semantics WITHOUT a consent snapshot. Always use Terminal.Confirm for terminal authorization. Rich mode does not affect this UI.
func (*Terminal) SelectMany ¶
type TerminalConfig ¶
TerminalConfig contains borrowed prompt handles, independent of data stdout. NoColor is the host's effective decision; the UI never reevaluates NO_COLOR.
type TerminalMode ¶
type TerminalMode string
TerminalMode selects interaction without changing host selection or consent policy.
const ( ModeAuto TerminalMode = "auto" ModeRich TerminalMode = "rich" ModePlain TerminalMode = "plain" )
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
func (*UI) Confirm ¶
func (u *UI) Confirm(ctx context.Context, req ConfirmRequest) (Confirmation, error)
func (*UI) SelectMany ¶
Source Files
¶
- terminal_api.go
- terminal_confirm.go
- terminal_consent.go
- terminal_consent_linux.go
- terminal_consent_unix.go
- terminal_faults.go
- terminal_handoff.go
- terminal_input_unix.go
- terminal_keys.go
- terminal_mode.go
- terminal_plain.go
- terminal_resize.go
- terminal_resources.go
- terminal_run.go
- terminal_select.go
- terminal_session.go
- terminal_theme.go
- terminal_validate.go
- ui.go