systeminfoview

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Height = 6
View Source
const ViewName = "systeminfo"
View Source
const Width = 40

Variables

This section is empty.

Functions

This section is empty.

Types

type HeartbeatMsg added in v2.1.0

type HeartbeatMsg struct{}

HeartbeatMsg is the daily timer firing: a session that is still open should re-report. Carries nothing — the model has everything the report needs.

type HeartbeatSentMsg added in v2.1.0

type HeartbeatSentMsg struct{}

HeartbeatSentMsg closes one heartbeat round. The app re-arms the timer on it rather than on HeartbeatMsg, so a slow or failed report cannot leave two rounds in flight — the same one-chain-in-one-chain-out rule the resource tick follows.

type LatestVersionMsg

type LatestVersionMsg struct {
	LatestVersion string
}

LatestVersionMsg reports that the version API returned a newer release than the running build. The app layer reads LatestVersion to raise the startup update notice, so the field is exported.

type Model

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

func New

func New(deps docker.Deps, version, edition string) *Model

Create a new instance

func (*Model) CheckLatestVersion

func (m *Model) CheckLatestVersion() tea.Cmd

func (*Model) HeartbeatCmd added in v2.1.0

func (m *Model) HeartbeatCmd() tea.Cmd

HeartbeatCmd re-reports a session that is still open, once a day.

Its own chain, re-armed by the caller on each HeartbeatMsg, and deliberately not folded into the 8-second resource tick: that one is a Docker fan-out and this one is a network call, so sharing a timer would tie the cheapest thing in the view to the most expensive.

Returns nil when there is nothing to report, so a build with the version check disabled — or a dev build — arms no timer at all rather than waking once a day to decide it has nothing to do.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init starts the header's timers.

It seeds the resource-usage loop with the first collection rather than with a tick, because that loop re-arms its own tick from SlowStatusMsg (update.go): arming one here as well would leave two chains running, and the collection is a per-container fan-out at the other end of the Docker socket. One chain in, one chain out — a round cannot start while a round is running.

func (*Model) Latest

func (m *Model) Latest() string

Latest returns the newest release reported by the version check, or "" if none has been observed yet. The app reads it to populate the on-demand update notice (the proactive notice is driven by LatestVersionMsg directly).

func (*Model) LoadSlowStatus

func (m *Model) LoadSlowStatus() tea.Cmd

func (*Model) LoadStatus

func (m *Model) LoadStatus() tea.Cmd

func (*Model) SendHeartbeat added in v2.1.0

func (m *Model) SendHeartbeat() tea.Cmd

SendHeartbeat reports the still-open session. Its answer is discarded: the update notice is a startup thing, and raising one a day later under somebody who has been working in the TUI since yesterday would be an interruption rather than news.

func (*Model) SetContent

func (m *Model) SetContent(msg Msg)

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type Msg

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

type NoVersionUpdateMsg

type NoVersionUpdateMsg struct{}

type SlowStatusMsg

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

type SpinnerTickMsg

type SpinnerTickMsg time.Time

type SystemInfoMsg

type SystemInfoMsg interface {
	// contains filtered or unexported methods
}

SystemInfoMsg is implemented by all messages owned by the systeminfo component. The app-level router uses this to forward messages without listing each type.

type TickMsg

type TickMsg time.Time

Jump to

Keyboard shortcuts

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