Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudEvent ¶
type CloudEvent struct { Time time.Time `json:"time"` Data any `json:"data,omitempty"` SpecVersion string `json:"specversion"` Type string `json:"type"` Source string `json:"source"` ID string `json:"id"` Subject string `json:"subject,omitempty"` DataSchema string `json:"dataschema,omitempty"` }
CloudEvent represents a CloudEvent.
func NewCloudEvent ¶
func NewCloudEvent(source, eventType string, data any, options ...CloudEventOption) (CloudEvent, error)
NewCloudEvent creates a new CloudEvent. By default a new UUID is generated for the ID, the current time is used for the Time and specversion is set to "1.0". This can be overridden by providing options.
func (CloudEvent) JSON ¶
func (e CloudEvent) JSON() []byte
JSON returns the JSON representation of the CloudEvent.
type CloudEventOption ¶
type CloudEventOption func(o *CloudEventOptions)
CloudEventOption is a function that sets options on a CloudEvent.
type CloudEventOptions ¶
type CloudEventOptions struct { Time time.Time ID string Subject string DataSchema string SpecVersion string }
CloudEventOptions contains options for a CloudEvent.
type Event ¶
type Event struct { Data any `json:"data"` Topic string `json:"topic"` Subject string `json:"subject"` Type string `json:"eventType"` Time time.Time `json:"eventTime"` ID string `json:"id"` DataVersion string `json:"dataVersion,omitempty"` MetadataVersion string `json:"metadataVersion,omitempty"` }
Event represents an event (Event Grid schema).
type EventGridEventOption ¶
type EventGridEventOption func(o *EventOptions)
EventOption is a function that sets options on an Event.
Click to show internal directories.
Click to hide internal directories.