This document highlights breaking changes in releases that will require some migration effort in your project. As we move towards a 1.0.0
release these will be restricted to major upgrades only, but currently, whilst the API is still being fleshed out in the 0.x
releases, they may be more frequent.
- The
test.NewConfig()
helper function has been removed. Instead, just useconfig.NewBuilder()
to build your config in your test code.
- The
DB
field inconfig.Config
has now been renamed todb
and is therefore unavailable outside of theconfig
package - The
data.MigrateDatabase()
function signature has changed: it now no longer needs a*config.Config
value as its second argument, instead it takes the schema name as a string instead (this should not affect user-land code). - The
data.NewDB()
function signature has changed: it now no longer needs alog.Logger
value as its second argument.
- The handler signature has now changed. The first argument is now a
context.Context
value to allow handlers to act upon cancellations and timeouts from this module. config.NewConfig()
function has been removed in favour of using the config builder, viaconfig.NewBuilder()
. See the docs for more information on how to use this.test.NewConfig()
argument types have changed to align it with the builder that it now uses underneath the hood:- The
sourceTopics
argument is now a[]string
instead ofstring
- The
retryIntervals
argument is now a[]int
instead ofstring
- The
config.Builder.SetTopicNameDecorator()
has been renamed toconfig.Builder.SetTopicNameGenerator()
which matches the concept and underlying field names better
test.ConsumeFromKafkaUntil()
now returns an error if the consuming failed, you will need to handle it if you are using this test helper in your integration test suiteconsumer.Start()
's parameters have now changed, there is no need to provide a channel for failures as this is now managed internallyconsumer.Start()
now returns an error if the consuming failed, you will need to handle this error, likely by logging it and exitingconsumer.NewCollection()
has been renamed toconsumer.newKafkaConsumerCollection()
, and is now no longer part of the public API of this module- The
consumer.ConsumerCollection
interface has been renamed toconsumer.collection
, and is now no longer part of the public API of this module - The
Failure
struct type has been moved todata/failure/model
package, previously it was in the module root consumer.NewConsumer()
function has been renamed toconsumer.newConsumer()
, and is now no longer part of the public API of this module.
config.NewConfig()
now returns an error value, as well as a*config.Config
value, so you will need to check for an error and handle it accordingly- You can now use
test.NewConfig()
to create aconfig.Config
value for testing. See testing for more information. - You can now use the
test.ConsumeFromKafkaUntil()
function in your integration tests to make it easier to wait until messages are consumed and conditions have been satisfied. See testing for more information.