Skip to content

Wrap the cloudevents client #92

Open
@xibz

Description

@xibz

Currently we use the raw cloudevents client directly. This can pose many problems in the future

  1. Breaking changes
  2. Complex flows

So instead we should wrap the client which mitigates the two problems listed above, and allows us to add custom patterns ourselves, e.g. hooks. Users should be able to provide their own client if they want, but we should always wrap the client for any SDK.

cc, err := cdevents.NewCDEventsClient(cdevents.WithPresendHook(func(client cdevents.Client) {
    log.Println("Some fancy logging")
})

// and allowing users to pass in their own client
cc, err := cdevents.NewCDEventsClient(cdevents.CDEventsClientOptions.WithCloudEventsClient(cloudeventsClient))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions