Documentation
¶
Overview ¶
Package live distributes committed logs and renders them only on gateways with interested viewers. Core NATS delivery is best effort, not a replay log.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrLiveResync = errors.New("live log view requires a fresh snapshot") ErrViewerQueueFull = fmt.Errorf("live viewer queue full: %w", ErrLiveResync) ErrInvalidSelector = errors.New("invalid live log instance selection") ErrClosed = errors.New("live logs are closed") )
Functions ¶
This section is empty.
Types ¶
type Logs ¶
type Logs struct {
// contains filtered or unexported fields
}
Logs owns live subscriptions, lazy rendering and publication budgets. It borrows a dedicated NATS connection; the composition root closes that last.
func (*Logs) AfterCommit ¶
AfterCommit accepts a bounded copy, regardless of this replica's viewers. Failure is a live-view failure, never a reason to retry a committed insert.
func (*Logs) AfterUncertainCommit ¶
AfterUncertainCommit is for a write whose outcome is unknown. The rows may be committed without publication, and a retry will not publish existing rows, so matching views must stop visibly instead of silently missing them.
type Selector ¶
type Selector struct {
Instances []string
}
An empty selection watches all instances; []string{""} watches the unnamed instance. Open copies the selection, so callers retain ownership of it.
func NewSelector ¶
NewSelector bounds subscription fanout and URL/subject size without treating punctuation, whitespace or an empty instance name as NATS syntax.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session owns a bounded viewer queue. Only done is closed; a concurrent renderer can never send to a closed data channel. HTML is immutable/shared.