Documentation
¶
Overview ¶
Package refreshstamp owns manager-side full-refresh labels, not panel timing. Callers serialize access and authenticate device results before confirmation.
Index ¶
- Variables
- func Bounds(size display.Size) (image.Rectangle, error)
- func Paint(frame display.Frame, label Label) error
- type Confirmation
- type CycleID
- type Label
- type Tracker
- func (t *Tracker) Abort(id CycleID) error
- func (t *Tracker) Begin(id CycleID, started time.Time) (Label, error)
- func (t *Tracker) Complete(id CycleID, completed time.Time) error
- func (t *Tracker) Confirmed() Confirmation
- func (t *Tracker) DiscardUnsent(id CycleID) error
- func (t *Tracker) ForPartial() (Label, error)
- func (t *Tracker) Invalidate()
Constants ¶
This section is empty.
Variables ¶
var ( ErrConfiguration = errors.New("refreshstamp: timezone required") ErrCycle = errors.New("refreshstamp: stale or conflicting cycle") ErrTime = errors.New("refreshstamp: trusted time unavailable or invalid") ErrUnconfirmed = errors.New("refreshstamp: full resynchronization required") )
var ErrOccupied = errors.New("refreshstamp: content occupies reserved corner")
Functions ¶
func Bounds ¶
Bounds derives the reserved rectangle from the existing timestamp font and padding. A smaller display rejects instead of shrinking unreadable glyphs.
func Paint ¶
Paint modifies only an empty reserved rectangle in borrowed frame storage. Run after HTML composition and before diff/encoding. It never hides visible content; layout-level occupancy diagnostics must be enforced separately. Partial updates pass the exact label returned by Tracker.ForPartial.
Types ¶
type Confirmation ¶
Confirmation records historical protocol evidence, not visible acceptance. It remains available after invalidation; ForPartial independently guards reuse.
type Label ¶
type Label struct {
// contains filtered or unexported fields
}
Label is immutable and constructed only from an explicitly supplied instant.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker is scoped to one coordinator/device session. IDs never repeat within that session. A fresh tracker requires full resync; it cannot restore from a wall clock or the retained e-paper image alone. The zero value rejects Begin.
func (*Tracker) Abort ¶
Abort covers failed or unknown results. No retry and no confirmed time advance. DiscardUnsent is deliberately separate: it requires proof of no device I/O.
func (*Tracker) Begin ¶
Begin stages a full cycle without confirming it. The caller establishes clock trust; this function only validates shape/order. No implicit time.Now or UTC fallback. UTC normalization deliberately uses wall instants across processes: https://pkg.go.dev/time#hdr-Monotonic_Clocks
func (*Tracker) Confirmed ¶
func (t *Tracker) Confirmed() Confirmation
func (*Tracker) DiscardUnsent ¶
DiscardUnsent releases preparation only. The caller must prove that no transport operation began; a failed/unknown send MUST use Abort/Invalidate. The old confirmed label survives, but the discarded ID cannot be reused.
func (*Tracker) ForPartial ¶
func (*Tracker) Invalidate ¶
func (t *Tracker) Invalidate()
Invalidate fences delayed completion after disconnect/reset/ambiguous state. Historical confirmation and used IDs remain; only a new full cycle restores reuse.