MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / NewEvent

Function NewEvent

internal/webhookpub/event.go:153–161  ·  view source on GitHub ↗

NewEvent constructs an Event with a fresh ID and now() timestamp. Trigger sites use this rather than building struct literals so the ID format stays consistent (evt_<32-hex>).

(eventType, userID string, data any)

Source from the content-addressed store, hash-verified

151// Trigger sites use this rather than building struct literals so the
152// ID format stays consistent (evt_<32-hex>).
153func NewEvent(eventType, userID string, data any) Event {
154 return Event{
155 ID: generateEventID(),
156 Type: eventType,
157 CreatedAt: time.Now().UTC(),
158 UserID: userID,
159 Data: data,
160 }
161}
162
163// Envelope is the wire shape sent in the HTTP body to webhook
164// subscribers. Stable across retries — the event_payload JSON column

Callers 8

handleTestWebhookMethod · 0.92
emitInboundResolvedMethod · 0.92
emitOutboundApprovedMethod · 0.92
emitOutboundRejectedMethod · 0.92
deliverToAgentMethod · 0.92
emitBlockedOutboundMethod · 0.92
generateEventIDForAgentFunction · 0.92
senderIdentityEventFirerFunction · 0.92

Calls 1

generateEventIDFunction · 0.85

Tested by

no test coverage detected