cliuimodel

package
v28.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ColorSpinner = "#3465A4"

ColorSpinner defines the foreground color for the spinner.

Variables

View Source
var Spinner = spinner.Spinner{
	Frames: []string{"◢ ", "◣ ", "◤ ", "◥ "},
	FPS:    time.Second / 5,
}

Spinner defines the spinner model animation.

Functions

func FormatView

func FormatView(view string) string

FormatView formats a model view padding and indentation.

func NewSpinner

func NewSpinner() spinner.Model

NewSpinner returns a new spinner model.

Types

type ErrorMsg

type ErrorMsg struct {
	Error error
}

ErrorMsg defines a message for errors.

type EventMsg

type EventMsg struct {
	events.Event

	Start    time.Time
	Duration time.Duration
}

EventMsg defines a message for events.

type Events

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

Events defines a model for events. The model renders a view that prints all received events one after the other. Status events are displayed with a spinner and removed from the list once they finish.

func NewEvents

func NewEvents(bus events.Provider) Events

NewEvents returns a new events model.

func (*Events) ClearEvents

func (m *Events) ClearEvents()

func (Events) Update

func (m Events) Update(msg tea.Msg) (Events, tea.Cmd)

func (Events) View

func (m Events) View() string

func (Events) Wait

func (m Events) Wait() tea.Cmd

func (Events) WaitEvent

func (m Events) WaitEvent() tea.Msg

type QuitMsg

type QuitMsg struct{}

QuitMsg defines a message for stopping the command.

type StatusEvents

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

StatusEvents defines a model for status events. The model renders a view that can be divided in three sections. The first one displays the "static" events which are the ones that are not status events. The second section displays a spinner with the status event that is in progress, and the third one displays a list with the past status events.

func NewStatusEvents

func NewStatusEvents(bus events.Provider, maxHistory int) StatusEvents

NewStatusEvents returns a new events model.

func (*StatusEvents) ClearEvents

func (m *StatusEvents) ClearEvents()

func (StatusEvents) Update

func (m StatusEvents) Update(msg tea.Msg) (StatusEvents, tea.Cmd)

func (StatusEvents) View

func (m StatusEvents) View() string

func (StatusEvents) Wait

func (m StatusEvents) Wait() tea.Cmd

func (StatusEvents) WaitEvent

func (m StatusEvents) WaitEvent() tea.Msg

Jump to

Keyboard shortcuts

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