Skip to content

Commit

Permalink
Add dataschema and datacontenttype to CloudEvent (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
elffjs committed Jun 20, 2024
1 parent 05212fc commit 55c6b38
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cloudevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@ type CloudEvent[A any] struct {
// this is always "1.0".
SpecVersion string `json:"specversion"`
// Subject is an optional field identifying the subject of the event within
// the context of the event producer.
// the context of the event producer. In practice, we always set this.
Subject string `json:"subject"`
// Time is an optional field giving the time at which the event occurred.
// Time is an optional field giving the time at which the event occurred. In
// practice, we always set this.
Time time.Time `json:"time"`
// Type describes the type of event. It should generally be a reverse-DNS
// name.
Type string `json:"type"`
// DataContentType is an optional MIME type for the data field. We almost
// always serialize to JSON and in that case this field is implicitly
// "application/json".
DataContentType string `json:"datacontenttype,omitempty"`
// DataSchema is an optional URI pointing to a schema for the data field.
DataSchema string `json:"dataschema,omitempty"`
// Data contains domain-specific information about the event.
Data A `json:"data"`
}

0 comments on commit 55c6b38

Please sign in to comment.