Documentation
¶
Index ¶
- Constants
- type HeartbeatMsg
- type HeartbeatSentMsg
- type LatestVersionMsg
- type Model
- func (m *Model) CheckLatestVersion() tea.Cmd
- func (m *Model) HeartbeatCmd() tea.Cmd
- func (m *Model) Init() tea.Cmd
- func (m *Model) Latest() string
- func (m *Model) LoadSlowStatus() tea.Cmd
- func (m *Model) LoadStatus() tea.Cmd
- func (m *Model) SendHeartbeat() tea.Cmd
- func (m *Model) SetContent(msg Msg)
- func (m *Model) Update(msg tea.Msg) tea.Cmd
- func (m *Model) View() string
- type Msg
- type NoVersionUpdateMsg
- type SlowStatusMsg
- type SpinnerTickMsg
- type SystemInfoMsg
- type TickMsg
Constants ¶
const Height = 6
const ViewName = "systeminfo"
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 (*Model) CheckLatestVersion ¶
func (*Model) HeartbeatCmd ¶ added in v2.1.0
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 ¶
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 ¶
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 (*Model) LoadStatus ¶
func (*Model) SendHeartbeat ¶ added in v2.1.0
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 ¶
type NoVersionUpdateMsg ¶
type NoVersionUpdateMsg struct{}
type SlowStatusMsg ¶
type SlowStatusMsg struct {
// contains filtered or unexported fields
}
type SpinnerTickMsg ¶
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.