Closed
Description
The CloudEvent
type is used heavily in the upcoming EventGrid SDK for Go, with potential future integration into other messaging SDKs like webpubsub, azeventhubs, and azservicebus.
The basic type is pretty simple:
type CloudEvent struct {
Data any // JSON serializable data
ID *string
// defaults to "1.0" (TODO: unsure if empty string is considered a valid version)
SpecVersion *string
}
The ID
and SpecVersion
fields will get default values
Some other bits I need to flesh out:
- CloudEvent has a concept of 'extensions', which allow you to plug in properties that are serialized at the root of the object.
- The actual model type has a property called data_base64, but the libraries all hide it. It's used internally for transport, but not exposed to the user directly.