Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap the cloudevents client #92

Open
xibz opened this issue Jul 31, 2024 · 0 comments
Open

Wrap the cloudevents client #92

xibz opened this issue Jul 31, 2024 · 0 comments

Comments

@xibz
Copy link

xibz commented Jul 31, 2024

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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: No status
Development

No branches or pull requests

1 participant