Documentation
¶
Overview ¶
Package nodestatus is the generated NodeStatus widget.
Edit the widget document and regenerate; edits here are overwritten.
Index ¶
- Constants
- func NodeStatusView(state NodeStatusState) templ.Component
- func NodeStatusViewAt(state NodeStatusState, region string) templ.Component
- type NodeStatus
- func (instance *NodeStatus[I]) Dirty(previous NodeStatusState, next NodeStatusState) bool
- func (instance *NodeStatus[I]) Mount(ctx context.Context, session live.Session[I]) (NodeStatusState, []live.Effect[I], error)
- func (instance *NodeStatus[I]) Reduce(state NodeStatusState, event live.Event) (NodeStatusState, []live.Effect[I])
- func (instance *NodeStatus[I]) Register() widget.Registration
- func (instance *NodeStatus[I]) Render(state NodeStatusState) templ.Component
- func (instance *NodeStatus[I]) Snapshot(state NodeStatusState) widget.Snapshot
- func (instance *NodeStatus[I]) Unmount(ctx context.Context, session live.Session[I], state NodeStatusState)
- type NodeStatusState
- func (state NodeStatusState) NodeALabel() string
- func (state NodeStatusState) SceneDescriptionLabel() string
- func (state NodeStatusState) SceneDescriptionText() string
- func (state NodeStatusState) StatusLabel() string
- func (state NodeStatusState) StatusText() string
- func (state NodeStatusState) TitleLabel() string
Constants ¶
const ( NodeStatusName = "NodeStatus" NodeStatusRegion = "widget.node-status" NodeStatusPalette = "fieldStation" NodeStatusTitleID = "widget.node-status-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 (
NodeStatusEventHealth = "widget.node-status.health"
)
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 (
NodeStatusEventHealthFieldReachable = "reachable"
)
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 NodeStatusView ¶
func NodeStatusView(state NodeStatusState) templ.Component
NodeStatusView draws the NodeStatus widget's default live region.
func NodeStatusViewAt ¶
func NodeStatusViewAt(state NodeStatusState, region string) templ.Component
NodeStatusViewAt 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 NodeStatus ¶
NodeStatus is the generated NodeStatus 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 NewNodeStatus ¶
func NewNodeStatus[I live.IIdentity]() *NodeStatus[I]
NewNodeStatus returns the widget a host registers, instantiated on that host's own identity type.
func NewNodeStatusAt ¶
func NewNodeStatusAt[I live.IIdentity](region string) *NodeStatus[I]
NewNodeStatusAt gives one instance its host-assigned region. The host validates region syntax and uniqueness when assembling its live configuration.
func (*NodeStatus[I]) Dirty ¶
func (instance *NodeStatus[I]) Dirty(previous NodeStatusState, next NodeStatusState) 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 (*NodeStatus[I]) Mount ¶
func (instance *NodeStatus[I]) Mount( ctx context.Context, session live.Session[I], ) (NodeStatusState, []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 (*NodeStatus[I]) Reduce ¶
func (instance *NodeStatus[I]) Reduce( state NodeStatusState, event live.Event, ) (NodeStatusState, []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 (*NodeStatus[I]) Register ¶
func (instance *NodeStatus[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 (*NodeStatus[I]) Render ¶
func (instance *NodeStatus[I]) Render(state NodeStatusState) templ.Component
Render draws the widget's live region. It is a pure function of state: equal state renders byte-identical markup.
func (*NodeStatus[I]) Snapshot ¶
func (instance *NodeStatus[I]) Snapshot(state NodeStatusState) widget.Snapshot
Snapshot projects state into ordered name/value pairs, in state-field declaration order.
func (*NodeStatus[I]) Unmount ¶
func (instance *NodeStatus[I]) Unmount(ctx context.Context, session live.Session[I], state NodeStatusState)
Unmount releases what the session held. This widget holds nothing.
type NodeStatusState ¶
type NodeStatusState struct {
// Reachable is the "reachable" state field, declared type flag.
Reachable bool
}
NodeStatusState 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 (NodeStatusState) NodeALabel ¶
func (state NodeStatusState) NodeALabel() string
NodeALabel is the "nodeALabel" label.
func (NodeStatusState) SceneDescriptionLabel ¶
func (state NodeStatusState) SceneDescriptionLabel() string
SceneDescriptionLabel is the "sceneDescriptionLabel" label.
func (NodeStatusState) SceneDescriptionText ¶
func (state NodeStatusState) SceneDescriptionText() string
SceneDescriptionText is the "sceneDescriptionText" binding. The first matching clause wins and the otherwise arm is always present, so it is total.
func (NodeStatusState) StatusLabel ¶
func (state NodeStatusState) StatusLabel() string
StatusLabel is the "statusLabel" label.
func (NodeStatusState) StatusText ¶
func (state NodeStatusState) StatusText() string
StatusText is the "statusText" binding. The first matching clause wins and the otherwise arm is always present, so it is total.
func (NodeStatusState) TitleLabel ¶
func (state NodeStatusState) TitleLabel() string
TitleLabel is the "titleLabel" label.