Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
Emitter sends events to a postDash service. If URL is empty, all operations are no-ops (zero overhead).
func (*Emitter) Emit ¶
Emit sends an event to the relay. Fire-and-forget — never blocks, never errors. If agentID is empty, the emitter's default agent ID is used.
func (*Emitter) EmitFull ¶
EmitFull sends a fully specified event to the relay. Source, TS, and AgentID (when empty) are filled automatically.
func (*Emitter) SetAgentID ¶
SetAgentID sets the default agent ID used when callers pass an empty string.
type Event ¶
type Event struct {
Source string `json:"source"`
Channel string `json:"channel,omitempty"`
Action string `json:"action"`
Level string `json:"level,omitempty"`
AgentID string `json:"agent_id,omitempty"`
DurationMS int64 `json:"duration_ms"`
Data map[string]any `json:"data,omitempty"`
TS time.Time `json:"ts"`
}
Event is the structured payload sent to postDash.
type EventEmitter ¶
EventEmitter sends structured events to an observability backend. The default implementation posts to a postDash HTTP endpoint. A no-op emitter is used when no URL is configured. Alternative implementations could log to files, send to different backends, etc.