devtui

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 12 Imported by: 0

README

devtui

interactive terminal user interface focused on developing applications

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorStyle

type ColorStyle struct {
	ForeGround string // eg: #F4F4F4
	Background string // eg: #000000
	Highlight  string // eg: #FF6600
	Lowlight   string // eg: #666666
}

type DevTUI

type DevTUI struct {
	*TuiConfig

	SectionFooter string
	// contains filtered or unexported fields
}

DevTUI mantiene el estado de la aplicación

func NewTUI

func NewTUI(c *TuiConfig) *DevTUI

func (*DevTUI) ContentView

func (h *DevTUI) ContentView() string

ContentView renderiza los mensajes para una sección de contenido

func (*DevTUI) Init

func (h *DevTUI) Init() tea.Cmd

Init inicializa el modelo

func (*DevTUI) Print

func (h *DevTUI) Print(messages ...any)

Print sends a normal Label or error to the tui

func (*DevTUI) PrintError

func (h *DevTUI) PrintError(messages ...any)

PrintError sends an error Label to the tui

func (*DevTUI) PrintInfo

func (h *DevTUI) PrintInfo(messages ...any)

PrintInfo sends an informational Label to the tui

func (*DevTUI) PrintOK

func (h *DevTUI) PrintOK(messages ...any)

PrintOK sends a success Label to the tui

func (*DevTUI) PrintWarning

func (h *DevTUI) PrintWarning(messages ...any)

PrintWarning sends a warning Label to the tui

func (*DevTUI) ReturnFocus

func (t *DevTUI) ReturnFocus() error

func (*DevTUI) SendMessage

func (t *DevTUI) SendMessage(content string, msgType MessageType)

SendMessage envía un mensaje al tui

func (*DevTUI) StartTUI

func (h *DevTUI) StartTUI(wg *sync.WaitGroup)

func (*DevTUI) Update

func (h *DevTUI) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update maneja las actualizaciones del estado

func (*DevTUI) View

func (h *DevTUI) View() string

func (*DevTUI) Write

func (h *DevTUI) Write(p []byte) (n int, err error)

Write implementa io.Writer para capturar la salida de otros procesos

type MessageType

type MessageType string

MessageType define el tipo de mensaje

const (
	NormMsg  MessageType = "normal"
	InfoMsg  MessageType = "info"
	ErrorMsg MessageType = "error"
	WarnMsg  MessageType = "warn"
	OkMsg    MessageType = "ok"
)

type SectionField

type SectionField 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) (runMessage string, err error) //eg: "8080" -> "9090" runMessage: "Port changed from 8080 to 9090"
	// contains filtered or unexported fields
}

Interface for handling tab field sectionFields

func (*SectionField) SetCursorAtEnd

func (cf *SectionField) SetCursorAtEnd()

type TabSection

type TabSection struct {
	Title         string         // eg: "BUILD", "TEST"
	SectionFields []SectionField // Field actions configured for the section
	SectionFooter string         // eg: "Press 't' to compile", "Press 'r' to run tests"
	// contains filtered or unexported fields
}

represent the tab section in the tui

type TuiConfig

type TuiConfig struct {
	TabIndexStart int          // is the index of the tab to start
	ExitChan      chan bool    //  global chan to close app
	TabSections   []TabSection // represent sections in the tui
	Color         *ColorStyle
}

Jump to

Keyboard shortcuts

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