events: Getters for event info (close #6377)

This commit is contained in:
Matthew Holt 2024-06-06 07:11:28 -06:00
parent 5db2f81695
commit 3f1add6c9f
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -355,6 +355,11 @@ type Event struct {
origin caddy.Module origin caddy.Module
} }
func (e Event) ID() uuid.UUID { return e.id }
func (e Event) Timestamp() time.Time { return e.ts }
func (e Event) Name() string { return e.name }
func (e Event) Origin() caddy.Module { return e.origin }
// CloudEvent exports event e as a structure that, when // CloudEvent exports event e as a structure that, when
// serialized as JSON, is compatible with the // serialized as JSON, is compatible with the
// CloudEvents spec. // CloudEvents spec.