nodestatus

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package nodestatus is the generated NodeStatus widget.

Edit the widget document and regenerate; edits here are overwritten.

Index

Constants

View Source
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.

View Source
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.

View Source
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

type NodeStatus[I live.IIdentity] struct {
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

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