Skip to content

Releases: cloudevents/sdk-go

Improved NATS, new STAN and gochan protocols.

24 Mar 15:11
123def5
Compare
Choose a tag to compare

Among bug fixes and improvements, this release includes:

  • a reworked NATS implementation that will give better controller over the sender and receiver queues.
  • first version of: STAN, streaming nats.
  • repackaging a test protocol into a real protocol for process local interactions: gochan.

A quick note: because the client interface is allowed to be given anything that implements one or more of the protocol interfaces, it is intended to use the sender and receiver protocols either directly, or to build up a client that only sends or only receives. This applies to all of the protocol impls, we are working on documenting this better.

Adding support for Pub/Sub, testing improvements.

20 Mar 15:08
0331394
Compare
Choose a tag to compare

We are increasing code coverage and confidence in v2, as this work is happening we are finding and fixing minor bugs. Getting ready for v2!

Increasing code coverage, fixing http issues

19 Mar 16:03
ecc0ec7
Compare
Choose a tag to compare

We found a couple issues with the new HTTP integration, like it was possible to default to HTTP GET if no options were set, and request content length was being set to empty on http requests.

We will continue to text and fix v2, but here is a snapshot.

Enable go mod v2

18 Mar 13:48
0a5202b
Compare
Choose a tag to compare
Enable go mod v2 Pre-release
Pre-release

Not much difference between -preview3, except we had to rearrange the packages to conform to how go mod expects imports at major version 2 to be.

So all imports for v2 now are at package github.com/cloudevents/sdk-go/v2 and we have dropped the usage of pkg. This means you can string replace github.com/cloudevents/sdk-go/pkg for github.com/cloudevents/sdk-go/v2.

Sorry for the churn, we did not understand there were special rules with go mod at v2 and above.

Adding "legacy" package to aid in migration

17 Mar 14:36
f248e16
Compare
Choose a tag to compare

We are adding a temporary legacy package that is the same as release v1.1.2 copied at package location github.com/cloudevents/sdk-go/legacy this package matches exactly the sdk at root v1, so to migrate to v2, search and replace imports from github.com/cloudevents/sdk-go to github.com/cloudevents/sdk-go/legacy. This will work for the alias file as well. Then use this preview to migrate to the new v2 API.

Let us know if you lack an alias or feature that is 100% required and can't do some other way in an issue.

More details can be found here: https://github.com/cloudevents/sdk-go/tree/v2.0.0-preview3/legacy

THANKS!

New Client interface.

16 Mar 19:20
3e150c4
Compare
Choose a tag to compare
New Client interface. Pre-release
Pre-release

In preview2 we are focusing on the new Client interface:

type Client interface {
	Send(ctx context.Context, event event.Event) error
	Request(ctx context.Context, event event.Event) (*event.Event, error)
	StartReceiver(ctx context.Context, fn interface{}) error
}

Where a full fn looks like
func(context.Context, event.Event) (*event.Event, transport.Result)

For protocols that do not support responses, StartReceiver will throw an error
when attempting to set a receiver fn with that capability.

For protocols that do not support responses from send (Requester interface),
Client.Request will throw an error.

Other things to note:

  • Transport has been renamed to Protocol.
  • Codec is dropped.
  • Direct HTTP handlers are now supported with helpers to convert to event.Event see the example.

v2 brings a reworked SDK

12 Mar 20:15
7b09386
Compare
Choose a tag to compare
Pre-release

Target initial release of 2.0.0 is about 2 weeks away (end of March, 2020). This is a preview release.

The main goal of the Go SDK v2 is to give more control to the integrators. This is very true for middleware, where you might want to have more control over the underlying transport lib and need less fancy features from this SDK. The second goal is to reduce the complexity of the SDK by not plumbing so many features through the client interface for overrides. This control should happen in your code if it is needed. So the client interface is geared towards event producers and consumers. The protocol layer is targeted towards the middleware writers.

There are many changes to Preview,

  • New Send/Request interface in Client.
  • A few client features have been dropped with an aim for reducing the complexity of the SDK by encouraging direct management of the underlying protocol and using a Protocol object that helps encode/decode Events
  • New shape for building Event.
    • Drop event.Data
    • Add event.SetData(contentType, object), forcing a content type to be set.
  • transport.Codec has been dropped in favor of Bindings and the ToEvent, WriteXX methods.
  • New object called Protocol, used to do the 3rd party interactions to message conversions and back.
    • Protocol ends up implementing transport.Sender, transport.Receiver, transport.Responder, and transport.Requester, as applicable.
  • ... and many more changes that will be details in the final docs. Some of these are API breaking changes.

All the samples have been updated to use the new interfaces.

To be done:

  • Final docs for new shapes.
  • More samples to show integration at a more basic level. (like just json, or just Protocol)
  • Rework client<->transport interactions.
  • Reworking the transport.Transport interface. This is not yet final. It will be reworked.
  • Add/confirm trace extension work is not lost in the migration.
  • Re-Add Pub/Sub support. (needs to be reworked in the new bindings format)

Clone Context before setting tracing extension.

06 Mar 20:14
a29c9e9
Compare
Choose a tag to compare

Change: Clone event context before setting the distributed tracing extension

  • A client change will prevent client from mutating the caller's copy of the event allowing for sharing across multiple clients.

Default to CloudEvents version 1.0

02 Mar 21:13
34d69b7
Compare
Choose a tag to compare

Default to CloudEvents version 1.0

Kafka Support and Tracing

02 Mar 16:07
bb1235c
Compare
Choose a tag to compare
  • Kafka Support added!
  • Added support for CloudEvents Tracing extension for HTTP.