module

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module interface {
	// Name returns the display name shown in the module's title bar.
	Name() string

	// Init returns the initial command (e.g. first data fetch).
	Init() tea.Cmd

	// Update handles messages. Return nil cmd if the message isn't relevant.
	Update(msg tea.Msg) tea.Cmd

	// View renders the module content (without the border/title — the
	// framework wraps it). width and height are the available content area.
	View(width, height int) string

	// MinSize returns the preferred minimum width and height (content area,
	// excluding border/padding). The layout engine uses these as hints.
	MinSize() (width, height int)
}

Module is the interface every Lattice module must implement. Modules are self-contained: they manage their own state, fetching, and rendering. The framework handles layout and lifecycle.

External modules should implement this interface and register themselves in their init() function using registry.Register().

Jump to

Keyboard shortcuts

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