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

Function generateEventID

internal/webhookpub/event.go:188–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186}
187
188func generateEventID() string {
189 b := make([]byte, 16)
190 if _, err := rand.Read(b); err != nil {
191 // crypto/rand failure means the OS RNG is broken; an
192 // all-zero event ID would collide across firings. Panic so
193 // the caller surfaces a 500 rather than silently emitting
194 // non-unique IDs.
195 panic(fmt.Sprintf("webhookpub: crypto/rand failed: %v", err))
196 }
197 return "evt_" + hex.EncodeToString(b)
198}
199
200// DeterministicEventID derives a stable event id from the trigger
201// context. Per design §5.1, the input formula per event type is:

Callers 1

NewEventFunction · 0.85

Calls 1

makeFunction · 0.85

Tested by

no test coverage detected