Documentation
¶
Overview ¶
Package operatorlog emits the owner-facing operator event feed. It turns typed domain.OperatorEvent values into durable send_dm actions targeting the dedicated EVENT_LOG_CHAT_ID, sharing the caller's transaction so a built event is atomic with the domain change that caused it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Outbox ¶
type Outbox interface {
Enqueue(
ctx context.Context,
input store.AccessActionInput,
) (domain.AccessAction, bool, error)
}
Outbox is the durable action surface the writer enqueues into. It is satisfied by *store.Outbox and by the engine/admission outbox interfaces, so the writer always rides the caller's transaction-bound outbox.
type Renderer ¶
type Renderer func(domain.OperatorEvent) (string, error)
Renderer turns a typed operator event into owner-facing HTML. A render failure is treated as a feed-build error: the event is skipped, never rolling back the domain change.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer emits operator events to the dedicated event-log chat.
func New ¶
New returns a writer that targets eventLogChatID. render must be a leaf renderer (typically messages.RenderOperatorEvent) so this package never imports message templates transitively into a cycle.
func (*Writer) Emit ¶
Emit renders ev and enqueues a durable send_dm to the event-log chat using the caller's transaction-bound outbox.
Two failure classes are handled differently (see the event-log spec):
- a render/build failure is logged and the event is skipped; the domain change is NOT rolled back (observability never gates access-control);
- a persistence (enqueue) failure propagates so the transaction fails like any other durable write.
A nil writer or outbox is a no-op, so callers can wire the feed optionally.