github.com/wfusion/gofusion@v1.1.14/common/infra/watermill/UPGRADE-1.0.md (about)

     1  # Upgrade instructions from v0.4.X
     2  
     3  In v1.0.0 we introduced a couple of breaking changes, to keep a stable API until version v2.
     4  
     5  ## Migrating Pub/Subs
     6  
     7  All Pub/Subs (excluding go-channel implementation) were moved to separated repositories.
     8  You can replace all import paths, with provided `sed`:
     9  
    10  	find . -type f -iname '*.go' -exec sed -i -E "s/github\.com\/ThreeDotsLabs\/watermill\/message\/infrastructure\/(amqp|googlecloud|http|io|kafka|nats|sql)/github.com\/ThreeDotsLabs\/watermill-\1\/pkg\/\1/" "{}" +;
    11  	find . -type f -iname '*.go' -exec sed -i -E "s/github\.com\/ThreeDotsLabs\/watermill\/message\/infrastructure\/gochannel/github\.com\/ThreeDotsLabs\/watermill\/pubsub\/gochannel/" "{}" +;
    12  
    13  # Breaking changes
    14  - `message.PubSub` interface was removed
    15  - `message.NewPubSub` constructor was removed
    16  - `message.NoPublishHandlerFunc` is now passed to `message.Router.AddNoPublisherHandler`, instead of `message.HandlerFunc`.
    17  - `message.Router.Run` now requires `context.Context` in parameter
    18  - `PrometheusMetricsBuilder.DecoratePubSub` was removed (because of `message.PubSub` interface removal)
    19  - `cars.ObjectName` was renamed to `cqrs.FullyQualifiedStructName`
    20  - `github.com/ThreeDotsLabs/watermill/message/infrastructure/gochannel` was moved to `github.com/ThreeDotsLabs/watermill/pubsub/gochannel`
    21  - `middleware.Retry` configuration parameters have been renamed
    22  - Universal Pub/Sub tests have been moved from `github.com/ThreeDotsLabs/watermill/message/infrastructure` to `github.com/ThreeDotsLabs/watermill/pubsub/tests`
    23  - All universal tests require now `TestContext`.
    24  - Removed `context` from `googlecloud.NewPublisher`