tui

package
v0.0.0-...-4ab85b2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableInput

func EnableInput(program *tea.Program)

EnableInput sends an enable input message to the given program

func Start

func Start(client ClientInterface) (*tea.Program, io.Writer)

Start creates and starts a new TUI program, returning the program and a writer for logging

Types

type ClientInterface

type ClientInterface interface {
	GetUsername() string
	GetAddress() string
	GetMaxLogLines() int
	SendChatMessage(msg string) error
	SendCommand(cmd string) error
	Disconnect(force bool) error
}

ClientInterface defines the methods required from a client for TUI interaction

type EnableInputMsg

type EnableInputMsg struct{}

EnableInputMsg is a message type to enable input

type LogMsg

type LogMsg string

LogMsg is a message type for logging

type TUI

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

TUI represents the terminal user interface for interactive mode

func New

func New(client ClientInterface) *TUI

New creates a new TUI instance

func (*TUI) AddLog

func (t *TUI) AddLog(msg string)

AddLog adds a log message to the TUI

func (*TUI) Init

func (t *TUI) Init() tea.Cmd

Init initializes the TUI

func (*TUI) Update

func (t *TUI) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles TUI updates

func (*TUI) View

func (t *TUI) View() string

View renders the TUI

type Writer

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

Writer is an io.Writer that sends output to the TUI

func NewWriter

func NewWriter(program *tea.Program) *Writer

NewWriter creates a new TUI Writer

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Write implements io.Writer

Jump to

Keyboard shortcuts

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