Documentation
¶
Overview ¶
Package clusterheartbeats is the generated ClusterHeartbeats widget.
Edit the widget document and regenerate; edits here are overwritten.
Index ¶
- Constants
- func ClusterHeartbeatsView(state ClusterHeartbeatsState) templ.Component
- func ClusterHeartbeatsViewAt(state ClusterHeartbeatsState, region string) templ.Component
- type ClusterHeartbeats
- func (instance *ClusterHeartbeats[I]) Dirty(previous ClusterHeartbeatsState, next ClusterHeartbeatsState) bool
- func (instance *ClusterHeartbeats[I]) Mount(ctx context.Context, session live.Session[I]) (ClusterHeartbeatsState, []live.Effect[I], error)
- func (instance *ClusterHeartbeats[I]) Reduce(state ClusterHeartbeatsState, event live.Event) (ClusterHeartbeatsState, []live.Effect[I])
- func (instance *ClusterHeartbeats[I]) Register() widget.Registration
- func (instance *ClusterHeartbeats[I]) Render(state ClusterHeartbeatsState) templ.Component
- func (instance *ClusterHeartbeats[I]) Snapshot(state ClusterHeartbeatsState) widget.Snapshot
- func (instance *ClusterHeartbeats[I]) Unmount(ctx context.Context, session live.Session[I], state ClusterHeartbeatsState)
- type ClusterHeartbeatsState
- func (state ClusterHeartbeatsState) AckLegendLabel() string
- func (state ClusterHeartbeatsState) ConnectionStatusLabel() string
- func (state ClusterHeartbeatsState) ConnectionStatusText() string
- func (state ClusterHeartbeatsState) ConnectionTone() string
- func (state ClusterHeartbeatsState) HeartbeatLegendLabel() string
- func (state ClusterHeartbeatsState) LeaderCaptionText() string
- func (state ClusterHeartbeatsState) LeaderTitleText() string
- func (state ClusterHeartbeatsState) Live() bool
- func (state ClusterHeartbeatsState) MotionActive() bool
- func (state ClusterHeartbeatsState) MotionActiveText() string
- func (state ClusterHeartbeatsState) MotionCaptionLabel() string
- func (state ClusterHeartbeatsState) MotionCaptionText() string
- func (state ClusterHeartbeatsState) MotionTickID() string
- func (state ClusterHeartbeatsState) MotionTickIDAt(region string) string
- func (state ClusterHeartbeatsState) MotionTogglePressedText() string
- func (state ClusterHeartbeatsState) NodeACaptionLabel() string
- func (state ClusterHeartbeatsState) NodeALabel() string
- func (state ClusterHeartbeatsState) NodeBCaptionLabel() string
- func (state ClusterHeartbeatsState) NodeBLabel() string
- func (state ClusterHeartbeatsState) NodeCCaptionLabel() string
- func (state ClusterHeartbeatsState) NodeCLabel() string
- func (state ClusterHeartbeatsState) QuorumKnown() bool
- func (state ClusterHeartbeatsState) QuorumStatLabel() string
- func (state ClusterHeartbeatsState) QuorumStatText() string
- func (state ClusterHeartbeatsState) SceneDescriptionLabel() string
- func (state ClusterHeartbeatsState) SceneDescriptionText() string
- func (state ClusterHeartbeatsState) TelemetryStatLabel() string
- func (state ClusterHeartbeatsState) TelemetryStatText() string
- func (state ClusterHeartbeatsState) TermStatLabel() string
- func (state ClusterHeartbeatsState) TermStatText() string
- func (state ClusterHeartbeatsState) WidgetSourceLabel() string
- func (state ClusterHeartbeatsState) WidgetTitleLabel() string
Constants ¶
const ( ClusterHeartbeatsName = "ClusterHeartbeats" ClusterHeartbeatsRegion = "widget.cluster-heartbeats" ClusterHeartbeatsPalette = "fieldStation" ClusterHeartbeatsTitleID = "widget.cluster-heartbeats-title" )
This widget's identity. The region is the only one that crosses the wire: a patch names it, so changing it is a client-visible change. The palette is a name a host resolves to values; this widget carries no colour of its own. The title id is what the widget's landmark is labelled by.
const ( ClusterHeartbeatsEventToggleMotion = "widget.cluster.motion-toggle" ClusterHeartbeatsEventSnapshot = "widget.cluster.snapshot" )
The wire names this widget accepts. The set is exhaustive and default-deny: a name absent from the registration is refused before any reducer runs.
const ( ClusterHeartbeatsEventSnapshotFieldSequence = "sequence" ClusterHeartbeatsEventSnapshotFieldConnected = "connected" ClusterHeartbeatsEventSnapshotFieldAuthoritative = "authoritative" ClusterHeartbeatsEventSnapshotFieldLeaderKnown = "leader_known" ClusterHeartbeatsEventSnapshotFieldHasQuorum = "has_quorum" ClusterHeartbeatsEventSnapshotFieldTerm = "term" ClusterHeartbeatsEventSnapshotFieldVoters = "voters" ClusterHeartbeatsEventSnapshotFieldAliveVoters = "alive_voters" )
The wire field names each event carries. They are the other half of an event's contract: the widget reads these out of a delivery, and whatever produced the delivery wrote them in. Registration.Payloads carries the same names as data, for a host that fills an event it cannot name at compile time.
Variables ¶
This section is empty.
Functions ¶
func ClusterHeartbeatsView ¶
func ClusterHeartbeatsView(state ClusterHeartbeatsState) templ.Component
ClusterHeartbeatsView draws the ClusterHeartbeats widget's default live region.
func ClusterHeartbeatsViewAt ¶
func ClusterHeartbeatsViewAt(state ClusterHeartbeatsState, region string) templ.Component
ClusterHeartbeatsViewAt draws one instance in its host-assigned live region.
Every value in it is a pure read of state and region: equal inputs render byte-identical markup: that comparison is what suppresses a patch nobody needs.
Types ¶
type ClusterHeartbeats ¶
ClusterHeartbeats is the generated ClusterHeartbeats widget.
I is the HOST's identity type, threaded through and never read: a widget document names no host, no address and no credential, so nothing here can look at an identity. It is a type parameter because the SDK's contract carries one — live.Session stopped erasing the application's identity type on 2026-09-03 — and a generated widget must fit whatever host registers it.
func NewClusterHeartbeats ¶
func NewClusterHeartbeats[I live.IIdentity]() *ClusterHeartbeats[I]
NewClusterHeartbeats returns the widget a host registers, instantiated on that host's own identity type.
func NewClusterHeartbeatsAt ¶
func NewClusterHeartbeatsAt[I live.IIdentity](region string) *ClusterHeartbeats[I]
NewClusterHeartbeatsAt gives one instance its host-assigned region. The host validates region syntax and uniqueness when assembling its live configuration.
func (*ClusterHeartbeats[I]) Dirty ¶
func (instance *ClusterHeartbeats[I]) Dirty(previous ClusterHeartbeatsState, next ClusterHeartbeatsState) bool
Dirty reports whether a transition may have changed this widget's markup: the state fields its bindings, its predicates and its tick read, and no others.
func (*ClusterHeartbeats[I]) Mount ¶
func (instance *ClusterHeartbeats[I]) Mount( ctx context.Context, session live.Session[I], ) (ClusterHeartbeatsState, []live.Effect[I], error)
Mount opens one session's copy of the widget. It schedules no effect: the streams this widget declared are the host's to open, because a widget document names no host, no address and no credential.
func (*ClusterHeartbeats[I]) Reduce ¶
func (instance *ClusterHeartbeats[I]) Reduce( state ClusterHeartbeatsState, event live.Event, ) (ClusterHeartbeatsState, []live.Effect[I])
Reduce is the pure transition from one state to the next. It performs no I/O, reads no clock and mutates nothing it was given.
func (*ClusterHeartbeats[I]) Register ¶
func (instance *ClusterHeartbeats[I]) Register() widget.Registration
Register declares this instance's definition and assigned region.
Events are the names a browser may send; Internal are the names only a declared stream delivers, which the host routes without registering.
func (*ClusterHeartbeats[I]) Render ¶
func (instance *ClusterHeartbeats[I]) Render(state ClusterHeartbeatsState) templ.Component
Render draws the widget's live region. It is a pure function of state: equal state renders byte-identical markup.
func (*ClusterHeartbeats[I]) Snapshot ¶
func (instance *ClusterHeartbeats[I]) Snapshot(state ClusterHeartbeatsState) widget.Snapshot
Snapshot projects state into ordered name/value pairs, in state-field declaration order.
func (*ClusterHeartbeats[I]) Unmount ¶
func (instance *ClusterHeartbeats[I]) Unmount(ctx context.Context, session live.Session[I], state ClusterHeartbeatsState)
Unmount releases what the session held. This widget holds nothing.
type ClusterHeartbeatsState ¶
type ClusterHeartbeatsState struct {
// Sequence is the "sequence" state field, declared type counter.
Sequence uint64
// Connected is the "connected" state field, declared type flag.
Connected bool
// Authoritative is the "authoritative" state field, declared type flag.
Authoritative bool
// LeaderKnown is the "leaderKnown" state field, declared type flag.
LeaderKnown bool
// HasQuorum is the "hasQuorum" state field, declared type flag.
HasQuorum bool
// Paused is the "paused" state field, declared type flag.
Paused bool
// Term is the "term" state field, declared type count.
Term int64
// Voters is the "voters" state field, declared type count.
Voters int64
// AliveVoters is the "aliveVoters" state field, declared type count.
AliveVoters int64
// Degraded is the "degraded" state field, declared type flag.
Degraded bool
}
ClusterHeartbeatsState is this widget's own state, and the type argument every method below is written in. The host holds it without knowing it; nothing in this file asserts it back, because nothing in this file ever loses it.
func (ClusterHeartbeatsState) AckLegendLabel ¶
func (state ClusterHeartbeatsState) AckLegendLabel() string
AckLegendLabel is the "ackLegendLabel" label.
func (ClusterHeartbeatsState) ConnectionStatusLabel ¶
func (state ClusterHeartbeatsState) ConnectionStatusLabel() string
ConnectionStatusLabel is the "connectionStatusLabel" label.
func (ClusterHeartbeatsState) ConnectionStatusText ¶
func (state ClusterHeartbeatsState) ConnectionStatusText() string
ConnectionStatusText is the "connectionStatusText" binding. The first matching clause wins and the otherwise arm is always present, so it is total.
func (ClusterHeartbeatsState) ConnectionTone ¶
func (state ClusterHeartbeatsState) ConnectionTone() string
ConnectionTone is the "connection" indicator's tone: positive while its predicate holds, warning otherwise.
func (ClusterHeartbeatsState) HeartbeatLegendLabel ¶
func (state ClusterHeartbeatsState) HeartbeatLegendLabel() string
HeartbeatLegendLabel is the "heartbeatLegendLabel" label.
func (ClusterHeartbeatsState) LeaderCaptionText ¶
func (state ClusterHeartbeatsState) LeaderCaptionText() string
LeaderCaptionText is the "leaderCaptionText" binding. The first matching clause wins and the otherwise arm is always present, so it is total.
func (ClusterHeartbeatsState) LeaderTitleText ¶
func (state ClusterHeartbeatsState) LeaderTitleText() string
LeaderTitleText is the "leaderTitleText" binding. The first matching clause wins and the otherwise arm is always present, so it is total.
func (ClusterHeartbeatsState) Live ¶
func (state ClusterHeartbeatsState) Live() bool
Live is the "live" predicate.
func (ClusterHeartbeatsState) MotionActive ¶
func (state ClusterHeartbeatsState) MotionActive() bool
MotionActive is this widget's compiled motion gate: everything its motion block requires, and none of what it forbids. The host's own connection status is the gate's other half and is applied by the stylesheet, so an animation cannot run against a dead connection whatever this returns.
func (ClusterHeartbeatsState) MotionActiveText ¶
func (state ClusterHeartbeatsState) MotionActiveText() string
MotionActiveText renders the gate into the attribute the stylesheet selects on.
func (ClusterHeartbeatsState) MotionCaptionLabel ¶
func (state ClusterHeartbeatsState) MotionCaptionLabel() string
MotionCaptionLabel is the "motionCaptionLabel" label.
func (ClusterHeartbeatsState) MotionCaptionText ¶
func (state ClusterHeartbeatsState) MotionCaptionText() string
MotionCaptionText is the "motionCaptionText" binding. The first matching clause wins and the otherwise arm is always present, so it is total.
func (ClusterHeartbeatsState) MotionTickID ¶
func (state ClusterHeartbeatsState) MotionTickID() string
MotionTickID is the scene's identity for one tick.
Every animation is finite and none repeats, so what starts one again is a new element: the scene carries this as its id, the tick advances, and the picture moves exactly as often as the data does.
func (ClusterHeartbeatsState) MotionTickIDAt ¶
func (state ClusterHeartbeatsState) MotionTickIDAt(region string) string
MotionTickIDAt namespaces the scene's tick identity under its live instance.
func (ClusterHeartbeatsState) MotionTogglePressedText ¶
func (state ClusterHeartbeatsState) MotionTogglePressedText() string
MotionTogglePressedText renders the "motionToggle" control's pressed state.
func (ClusterHeartbeatsState) NodeACaptionLabel ¶
func (state ClusterHeartbeatsState) NodeACaptionLabel() string
NodeACaptionLabel is the "nodeACaptionLabel" label.
func (ClusterHeartbeatsState) NodeALabel ¶
func (state ClusterHeartbeatsState) NodeALabel() string
NodeALabel is the "nodeALabel" label.
func (ClusterHeartbeatsState) NodeBCaptionLabel ¶
func (state ClusterHeartbeatsState) NodeBCaptionLabel() string
NodeBCaptionLabel is the "nodeBCaptionLabel" label.
func (ClusterHeartbeatsState) NodeBLabel ¶
func (state ClusterHeartbeatsState) NodeBLabel() string
NodeBLabel is the "nodeBLabel" label.
func (ClusterHeartbeatsState) NodeCCaptionLabel ¶
func (state ClusterHeartbeatsState) NodeCCaptionLabel() string
NodeCCaptionLabel is the "nodeCCaptionLabel" label.
func (ClusterHeartbeatsState) NodeCLabel ¶
func (state ClusterHeartbeatsState) NodeCLabel() string
NodeCLabel is the "nodeCLabel" label.
func (ClusterHeartbeatsState) QuorumKnown ¶
func (state ClusterHeartbeatsState) QuorumKnown() bool
QuorumKnown is the "quorumKnown" predicate.
func (ClusterHeartbeatsState) QuorumStatLabel ¶
func (state ClusterHeartbeatsState) QuorumStatLabel() string
QuorumStatLabel is the "quorumStatLabel" label.
func (ClusterHeartbeatsState) QuorumStatText ¶
func (state ClusterHeartbeatsState) QuorumStatText() string
QuorumStatText is the "quorumStatText" binding. The first matching clause wins and the otherwise arm is always present, so it is total.
func (ClusterHeartbeatsState) SceneDescriptionLabel ¶
func (state ClusterHeartbeatsState) SceneDescriptionLabel() string
SceneDescriptionLabel is the "sceneDescriptionLabel" label.
func (ClusterHeartbeatsState) SceneDescriptionText ¶
func (state ClusterHeartbeatsState) SceneDescriptionText() string
SceneDescriptionText is the "sceneDescriptionText" binding. The first matching clause wins and the otherwise arm is always present, so it is total.
func (ClusterHeartbeatsState) TelemetryStatLabel ¶
func (state ClusterHeartbeatsState) TelemetryStatLabel() string
TelemetryStatLabel is the "telemetryStatLabel" label.
func (ClusterHeartbeatsState) TelemetryStatText ¶
func (state ClusterHeartbeatsState) TelemetryStatText() string
TelemetryStatText is the "telemetryStatText" binding. The first matching clause wins and the otherwise arm is always present, so it is total.
func (ClusterHeartbeatsState) TermStatLabel ¶
func (state ClusterHeartbeatsState) TermStatLabel() string
TermStatLabel is the "termStatLabel" label.
func (ClusterHeartbeatsState) TermStatText ¶
func (state ClusterHeartbeatsState) TermStatText() string
TermStatText is the "termStatText" binding. The first matching clause wins and the otherwise arm is always present, so it is total.
func (ClusterHeartbeatsState) WidgetSourceLabel ¶
func (state ClusterHeartbeatsState) WidgetSourceLabel() string
WidgetSourceLabel is the "widgetSourceLabel" label.
func (ClusterHeartbeatsState) WidgetTitleLabel ¶
func (state ClusterHeartbeatsState) WidgetTitleLabel() string
WidgetTitleLabel is the "widgetTitleLabel" label.