Documentation
¶
Index ¶
- type ColorStyle
- type DevTUI
- func (t *DevTUI) AddTabSections(sections ...TabSection) *DevTUI
- func (h *DevTUI) ContentView() string
- func (t *DevTUI) GetTotalTabSections() int
- func (h *DevTUI) HandleKeyboard(msg tea.KeyMsg) (bool, tea.Cmd)
- func (h *DevTUI) Init() tea.Cmd
- func (h *DevTUI) InitTUI(args ...any)
- func (h *DevTUI) Print(messages ...any)
- func (t *DevTUI) ReturnFocus() error
- func (h *DevTUI) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (h *DevTUI) View() string
- type FieldHandler
- type TabSection
- type TuiConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColorStyle ¶
type DevTUI ¶
type DevTUI struct {
*TuiConfig
// contains filtered or unexported fields
}
DevTUI mantiene el estado de la aplicación
func DefaultTUIForTest ¶ added in v0.0.10
NewDefaultTUI creates a DevTUI instance with basic default configuration useful for unit tests and for quick initialization in real applications
func (*DevTUI) AddTabSections ¶ added in v0.0.9
func (t *DevTUI) AddTabSections(sections ...TabSection) *DevTUI
AddTabSections adds one or more TabSections to the DevTUI If a tab with title "DEFAULT" exists, it will be replaced by the first tab section
func (*DevTUI) ContentView ¶
ContentView renderiza los mensajes para una sección de contenido
func (*DevTUI) GetTotalTabSections ¶ added in v0.0.9
GetTotalTabSections returns the total number of tab sections
func (*DevTUI) HandleKeyboard ¶ added in v0.0.10
HandleKeyboard processes keyboard input and updates the model state returns whether the update function should continue processing or return early
func (*DevTUI) InitTUI ¶ added in v0.0.5
InitTUI initializes and runs the terminal UI application.
It accepts optional variadic arguments of any type. If a *sync.WaitGroup is provided among these arguments, InitTUI will call its Done() method before returning.
The method runs the UI using the internal tea engine, and handles any errors that may occur during execution. If an error occurs, it will be displayed on the console and the application will wait for user input before exiting.
Parameters:
- args ...any: Optional arguments. Can include a *sync.WaitGroup for synchronization.
func (*DevTUI) ReturnFocus ¶
type FieldHandler ¶ added in v0.0.7
type FieldHandler struct {
Name string // eg: "port", "Server Port", "8080"
Label string // eg: "Server Port"
Value string // eg: "8080"
Editable bool // if no editable eject the action FieldValueChange directly
FieldValueChange func(newValue string) (execMessage string, err error) //eg: "8080" -> "9090" execMessage: "Port changed from 8080 to 9090"
// contains filtered or unexported fields
}
Interface for handling tab field sectionFields
func (*FieldHandler) SetCursorAtEnd ¶ added in v0.0.7
func (cf *FieldHandler) SetCursorAtEnd()
type TabSection ¶
type TabSection struct {
Title string // eg: "BUILD", "TEST"
FieldHandlers []FieldHandler // Field actions configured for the section
// contains filtered or unexported fields
}
represent the tab section in the tui