Documentation
¶
Overview ¶
Package uxBlock provides building blocks for UX and communication with a user.
Index ¶
- type Blocks
- func (b *Blocks) GetDebugFileLogger() logger.Logger
- func (b *Blocks) GetOutputLogger() logger.Logger
- func (b *Blocks) LogDebug(message string)
- func (b *Blocks) PrintError(line styles.Line)
- func (b *Blocks) PrintInfo(line styles.Line)
- func (b *Blocks) PrintWarning(line styles.Line)
- func (b *Blocks) Prompt(ctx context.Context, message string, choices []string, ...) (int, error)
- func (b *Blocks) RunSpinners(ctx context.Context, spinners []*Spinner) func()
- func (b *Blocks) Select(ctx context.Context, tableBody *TableBody, auxOptions ...SelectOption) ([]int, error)
- func (b *Blocks) Table(body *TableBody, auxOptions ...TableOption)
- type PromptOption
- type SelectOption
- type Spinner
- type TableBody
- type TableCell
- type TableOption
- type TableRow
- type UxBlocks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blocks ¶ added in v1.0.38
type Blocks struct {
TerminalWidth int
TerminalHeight int
// contains filtered or unexported fields
}
func (*Blocks) GetDebugFileLogger ¶ added in v1.0.40
func (*Blocks) GetOutputLogger ¶ added in v1.0.40
func (*Blocks) PrintError ¶ added in v1.0.38
func (*Blocks) PrintWarning ¶ added in v1.0.38
func (*Blocks) RunSpinners ¶ added in v1.0.38
func (*Blocks) Table ¶ added in v1.0.38
func (b *Blocks) Table(body *TableBody, auxOptions ...TableOption)
type PromptOption ¶
type PromptOption = func(cfg *promptConfig)
type SelectOption ¶
type SelectOption = func(cfg *selectConfig)
func SelectEnableMultiSelect ¶
func SelectEnableMultiSelect() SelectOption
func SelectLabel ¶
func SelectLabel(label string) SelectOption
func SelectTableHeader ¶
func SelectTableHeader(header *TableRow) SelectOption
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
func (*Spinner) FinishWithError ¶ added in v1.0.38
func (*Spinner) LogView ¶ added in v1.0.38
func (s *Spinner) LogView() io.WriteCloser
type TableBody ¶
type TableBody struct {
// contains filtered or unexported fields
}
func NewTableBody ¶
func NewTableBody() *TableBody
func (*TableBody) AddStringsRow ¶
func (*TableBody) AddStringsRows ¶
type TableOption ¶
type TableOption = func(cfg *tableConfig)
func WithTableHeader ¶
func WithTableHeader(header *TableRow) TableOption
type TableRow ¶
type TableRow struct {
// contains filtered or unexported fields
}
func NewTableRow ¶
func NewTableRow() *TableRow
func (*TableRow) AddStringCell ¶
func (*TableRow) AddStringCells ¶
type UxBlocks ¶
type UxBlocks interface {
GetOutputLogger() logger.Logger
GetDebugFileLogger() logger.Logger
LogDebug(message string)
PrintInfo(line styles.Line)
PrintWarning(line styles.Line)
PrintError(line styles.Line)
Table(body *TableBody, auxOptions ...TableOption)
Select(ctx context.Context, tableBody *TableBody, auxOptions ...SelectOption) ([]int, error)
Prompt(
ctx context.Context,
message string,
choices []string,
auxOptions ...PromptOption,
) (int, error)
RunSpinners(ctx context.Context, spinners []*Spinner) func()
}
Click to show internal directories.
Click to hide internal directories.