model

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tick

func Tick() tea.Cmd

Tick returns a tea.Cmd that updates the model every second

Types

type ErrMsg

type ErrMsg struct {
	Err error
}

ErrMsg wraps an error

type Model

type Model struct {
	CPU     stats.CPUStats
	Mem     stats.MemStats
	Disk    stats.DiskStats
	Err     error
	Version string

	UI UIData
}

Model represents app state

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) UsageBar

func (m Model) UsageBar(filledValue int) string

UsageBar returns a simple bar graph for percentage values

func (Model) View

func (m Model) View() string

View renders the terminal UI

type StatsMsg

type StatsMsg struct {
	CPU  stats.CPUStats
	Mem  stats.MemStats
	Disk stats.DiskStats
}

type UIData

type UIData struct {
	CPUPercent   float64
	MemPercent   float64
	CPUBarFill   int
	MemBarFill   int
	MemUsedStr   string
	MemTotalStr  string
	DiskPercent  float64
	DiskUsedStr  string
	DiskTotalStr string
}

Jump to

Keyboard shortcuts

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