uxBlock

package
v1.0.55 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: MIT Imports: 15 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 Run added in v1.0.46

func Run[T any](
	model tea.Model,
	get GetFunc[T],
	opts ...tea.ProgramOption,
) (T, error)

Run runs tea.Model and returns value based on GetFunc[T]

func Void added in v1.0.46

func Void(tea.Model) (struct{}, error)

Types

type Blocks added in v1.0.38

type Blocks struct {
	TerminalWidth  int
	TerminalHeight int
	// contains filtered or unexported fields
}

func NewBlocks added in v1.0.38

func NewBlocks(
	outputLogger logger.Logger,
	debugFileLogger logger.Logger,
	isTerminal bool,
	terminalWidth int,
	terminalHeight int,
	ctxCancel context.CancelFunc,
) *Blocks

func (*Blocks) GetDebugFileLogger added in v1.0.40

func (b *Blocks) GetDebugFileLogger() logger.Logger

func (*Blocks) GetOutputLogger added in v1.0.40

func (b *Blocks) GetOutputLogger() logger.Logger

func (*Blocks) LogDebug added in v1.0.38

func (b *Blocks) LogDebug(message string)

func (*Blocks) PrintError added in v1.0.38

func (b *Blocks) PrintError(line styles.Line)

func (*Blocks) PrintErrorText added in v1.0.44

func (b *Blocks) PrintErrorText(in string)

func (*Blocks) PrintErrorTextf added in v1.0.55

func (b *Blocks) PrintErrorTextf(format string, args ...any)

func (*Blocks) PrintInfo added in v1.0.38

func (b *Blocks) PrintInfo(line styles.Line)

func (*Blocks) PrintInfoText added in v1.0.44

func (b *Blocks) PrintInfoText(in string)

func (*Blocks) PrintInfoTextf added in v1.0.55

func (b *Blocks) PrintInfoTextf(format string, args ...any)

func (*Blocks) PrintSuccessText added in v1.0.46

func (b *Blocks) PrintSuccessText(in string)

func (*Blocks) PrintSuccessTextf added in v1.0.55

func (b *Blocks) PrintSuccessTextf(format string, args ...any)

func (*Blocks) PrintWarning added in v1.0.38

func (b *Blocks) PrintWarning(line styles.Line)

func (*Blocks) PrintWarningText added in v1.0.44

func (b *Blocks) PrintWarningText(in string)

func (*Blocks) PrintWarningTextf added in v1.0.55

func (b *Blocks) PrintWarningTextf(format string, args ...any)

func (*Blocks) RunSpinners added in v1.0.38

func (b *Blocks) RunSpinners(ctx context.Context, spinners []*Spinner) (func(), func(msg tea.Msg))

type GetFunc added in v1.0.46

type GetFunc[T any] func(model tea.Model) (T, error)

type Spinner

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

func NewSpinner

func NewSpinner(line string) *Spinner

func (*Spinner) Finish

func (s *Spinner) Finish() tea.Msg

func (*Spinner) FinishWithLine added in v1.0.46

func (s *Spinner) FinishWithLine(msg string) tea.Msg

func (*Spinner) LogView added in v1.0.38

func (s *Spinner) LogView(opts ...logView.Option) io.WriteCloser

type UxBlocks

type UxBlocks interface {
	GetOutputLogger() logger.Logger
	GetDebugFileLogger() logger.Logger
	LogDebug(message string)
	PrintInfo(line styles.Line)
	PrintInfoText(string)
	PrintWarning(line styles.Line)
	PrintWarningText(string)
	PrintError(line styles.Line)
	PrintErrorText(string)
	RunSpinners(ctx context.Context, spinners []*Spinner) (func(), func(msg tea.Msg))
}

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