Releases: cloudevents/sdk-go
Release 0.6.0, Subject, DataContentEncoding and Setters/Access for Event attributes.
- Switched to Zap logging.
- Added Subject.
- Added DataEncodingType
- Added to level alias. Import
github.com/cloudevents/sdk-go
to get 80% of sdk. - Added Setter/Access style methods on Event object level to aid in event creation an inspection of attributes without context version awareness.
Go style event creation still works, but now this is an option:
event := cloudevents.NewEvent()
event.SetID("ABC-123")
event.SetType("com.cloudevents.readme.sent")
event.SetSource("http://localhost:8080/")
event.SetData(data)
Note that event will default to version 0.2
, the latest released CloudEvents
spec version at this time.
With the top level alias, this is possible:
t, err := cloudevents.NewHTTPTransport(
cloudevents.WithTarget("http://localhost:8080/"),
cloudevents.WithEncoding(cloudevents.HTTPBinaryV02),
)
// handle error
c, err := cloudevents.NewClient(t)
// handle error
c.Send(ctx, event);
Note that the previously named method httptransport.New
is changed to cloudevents.NewHTTPTransport
the alias.go file is a good place to see
the api at a glance.
Release 0.5.0 adds alias to top level.
No huge more import blocks! See the examples for import updates. 90% of the common objects have been exposed via alias.go. Use this to pull in and create the clients, transports, and cloudevents.
Bug fixes and more tests were added between 0.4.0 and 0.5.0 related to header handling.
Release 0.4.4 fixed a bug with duplicated headers in the context.
Headers were being mutated in the context of http transport, causing each new send to add a duplicate header. This no longer happens.
Release 0.4.3 Adds cloudevents/sdk-go/ to measurements.
It was found that name collisions panic the collector when integrating with projects that also collect metrics. This release fixes that.
Release 0.4.2 Enables adding custom response headers for http transport.
Also more godocs.
Release 0.4.1 adds OpenCensus support and Http Header control.
Basic integration with OpenCensus was added. There is an example stats exporter.
Http headers and now controllable using new context methods. Checkout the pr that added this.
The client and transport APIs should be the same between 0.4.0 and 0.4.1.
Release 0.4.0: Updated Clients, Reflection for Receivers
Client now expects a transport to be injected. Client.StartReceive(ctx, fn)
has been updated to use reflection for fn
, where fn
can now have optional responses and/or errors. See the godocs for details.
Release 0.3.0 - Rewrite of SDK
In this release the SDK has been rewritten to decouple the event from the transport. It is suggested that your client code integrate with the client.Client interface. You can inject your own transport if it adheres to transport.Transport interface.
This is still a work in progress with many open issues. Please file bugs or feature requests for interesting things you encounter.
Release 0.2.0
For this release extensions have been moved to top level properties. Previously extensions were defined in an extensions map, which was itself a top level property. All CloudEvent properties can be accessed using the generic Get method, or the type checked versions, e.g. GetString, GetMap, etc., but only the well known properties allow for direct field access. The marshallers handle packing and unpacking the extensions into an internal map.
This release also makes significant changes to the CloudEvent property names. All property names on the wire are now lower case with no separator characters. This ensures that these names are recognized across transports, which have different standards for property names. This release also removes the redundant 'event' prefix on property names. So EventType becomes Type and EventID become ID, etc. One special case is CloudEventsVersion, which becomes SpecVersion.