Merge pull request #5 from clemensv/master
Versioning defaults and doc adjustment
This commit is contained in:
commit
2997832920
30
README.md
30
README.md
|
@ -10,18 +10,26 @@ The `CloudNative.CloudEvents` package provides utility methods and classes for c
|
||||||
## CloudEvent
|
## CloudEvent
|
||||||
|
|
||||||
The `CloudEvent` class reflects the event envelope defined by the CNCF CloudEvents specification.
|
The `CloudEvent` class reflects the event envelope defined by the CNCF CloudEvents specification.
|
||||||
|
It supports both version 0.1 and (yet to be finalized) version 0.2 of the CloudEvents specification,
|
||||||
|
even though the strongly typed API already reflects the 0.2 naming.
|
||||||
|
|
||||||
| CloudEvents attribute | Property name | CLR type
|
The default specification version is 0.2, you can override this by specifying the version explicitly:
|
||||||
|-----------------------|----------------------------|----------
|
`new CloudEvent(CloudEventsSpecVersion.V0_1)`. The `SpecVersion` property also allows the
|
||||||
| id | `CloudEvent.Id` | `System.String`
|
version to be switched, meaning you can receive a 0.1 event, switch the version number, and forward
|
||||||
| type | `CloudEvent.Type` | `System.String`
|
it as a 0.2 event.
|
||||||
| specversion | `CloudEvent.SpecVersion` | `System.String`
|
|
||||||
| time | `CloudEvent.Time` | `System.DateTime`
|
|
||||||
| source | `CloudEvent.Source` | `System.Uri`
|
| 0.1 | 0.2 | Property name | CLR type
|
||||||
| schemaurl | `CloudEvent.SchemaUrl` | `System.Uri`
|
|-----------------------|-----------------------|----------------------------|----------
|
||||||
| source | `CloudEvent.Source` | `System.Uri`
|
| eventID | id | `CloudEvent.Id` | `System.String`
|
||||||
| contenttype | `CloudEvent.ContentType` | `System.Net.Mime.ContentType`
|
| eventType | type | `CloudEvent.Type` | `System.String`
|
||||||
| data | `CloudEvent.Data` | `System.Object`
|
| cloudEventsVersion | specversion | `CloudEvent.SpecVersion` | `System.String`
|
||||||
|
| eventTime | time | `CloudEvent.Time` | `System.DateTime`
|
||||||
|
| source | source | `CloudEvent.Source` | `System.Uri`
|
||||||
|
| schemaUrl | schemaurl | `CloudEvent.SchemaUrl` | `System.Uri`
|
||||||
|
| source | source | `CloudEvent.Source` | `System.Uri`
|
||||||
|
| contentType | contenttype | `CloudEvent.ContentType` | `System.Net.Mime.ContentType`
|
||||||
|
| data | data | `CloudEvent.Data` | `System.Object`
|
||||||
|
|
||||||
|
|
||||||
The `CloudEvent.Data` property is `object` typed, and may hold any valid serializable
|
The `CloudEvent.Data` property is `object` typed, and may hold any valid serializable
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace CloudNative.CloudEvents
|
||||||
return (val as string) == "0.1" ? CloudEventsSpecVersion.V0_1 : CloudEventsSpecVersion.V0_2;
|
return (val as string) == "0.1" ? CloudEventsSpecVersion.V0_1 : CloudEventsSpecVersion.V0_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CloudEventsSpecVersion.V0_2;
|
return CloudEventsSpecVersion.Default;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue