uxBlock

package
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package uxBlock provides building blocks for UX and communication with a user.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBlock

func NewBlock(
	outputLogger logger.Logger,
	debugFileLogger logger.Logger,
	isTerminal bool,
	terminalWidth int,
	ctxCancel context.CancelFunc,
) *uxBlocks

func XXX

func XXX(cmdList ...tea.Cmd) func() tea.Msg

Types

type MergeMessage

type MergeMessage []tea.Cmd

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 NewSpinner

func NewSpinner(line styles.Line) *Spinner

func (*Spinner) Finish

func (s *Spinner) Finish(text styles.Line) *Spinner

func (*Spinner) SetMessage

func (s *Spinner) SetMessage(text styles.Line) *Spinner

type SpinnerOption

type SpinnerOption = func(cfg *spinnerConfig)

type TableBody

type TableBody struct {
	// contains filtered or unexported fields
}

func NewTableBody

func NewTableBody() *TableBody

func (*TableBody) AddRow

func (b *TableBody) AddRow(row *TableRow)

func (*TableBody) AddStringsRow

func (b *TableBody) AddStringsRow(cells ...string) *TableBody

func (*TableBody) AddStringsRows

func (b *TableBody) AddStringsRows(rows ...[]string) *TableBody

type TableCell

type TableCell struct {
	Text string
}

func NewTableCell

func NewTableCell(text string) *TableCell

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) AddCell

func (r *TableRow) AddCell(cell *TableCell) *TableRow

func (*TableRow) AddStringCell

func (r *TableRow) AddStringCell(text string) *TableRow

func (*TableRow) AddStringCells

func (r *TableRow) AddStringCells(cells ...string) *TableRow

type UxBlocks

type UxBlocks interface {
	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, auxOptions ...SpinnerOption) func()
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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