Skip to content

Conversation

@afrittoli
Copy link
Contributor

Change CDEventType to be a struct to allow for one-time parsing of the type string. The event type is still stored as string in the context so that it may unmarshal without the need for a custom unmarshaller.

When producing events, the SDK produces the latest version of an event, the only one know to the SDK.
When consuming events, the SDK allows for versions different from the SDK ones, as long as they are compatible with the SDK one, according to the versioning rules from the spec.

The spec submodule has been moved into pkg/api so that we may use go embed to embed the schemas from the spec into the event modules which allows to embed the schema definitions in the SDK module.

Change CDEventType to be a struct to allow for one-time parsing
of the type string. The event type is still stored as string in
the context so that it may unmarshal without the need for a
custom unmarshaller.

When producing events, the SDK produces the latest version of an
event, the only one know to the SDK.
When consuming events, the SDK allows for versions different from
the SDK ones, as long as they are compatible with the SDK one,
according to the versioning rules from the spec.

The spec submodule has been moved into pkg/api so that we may use
go embed to embed the schemas from the spec into the event modules
which allows to embed the schema definitions in the SDK module.

Signed-off-by: Andrea Frittoli <[email protected]>
@afrittoli afrittoli force-pushed the handle_versions branch 2 times, most recently from d851b73 to 7863790 Compare March 20, 2023 13:50
Signed-off-by: Andrea Frittoli <[email protected]>
@afrittoli afrittoli merged commit 8490c24 into cdevents:main Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant