package
0.0.0-20230102091508-02d5eeac7d74
Repository: https://github.com/golang-boy/watermill.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# Functions

HandlerNameFromCtx returns the name of the message handler in the router that consumed the message.
MessageTransformPublisherDecorator creates a publisher decorator that calls transform on each message that passes through the publisher.
MessageTransformSubscriberDecorator creates a subscriber decorator that calls transform on each message that passes through the subscriber.
NewMessage creates a new Message with given uuid and payload.
NewRouter creates a new Router with given configuration.
PublisherNameFromCtx returns the name of the message publisher type that published the message in the router.
PublishTopicFromCtx returns the topic to which message will be published by the router.
SubscriberNameFromCtx returns the name of the message subscriber type that subscribed to the message in the router.
SubscribeTopicFromCtx returns the topic from which message was received in the router.

# Variables

ErrOutputInNoPublisherHandler happens when a handler func returned some messages in a no-publisher handler.
PassthroughHandler is a handler that passes the message unchanged from the subscriber to the publisher.

# Structs

DuplicateHandlerNameError is sent in a panic when you try to add a second handler with the same name.
Handler handles Messages.
Message is the basic transfer unit.
Router is responsible for handling messages from subscribers using provided handler functions.
RouterConfig holds the Router's configuration options.

# Interfaces

Publisher is the emitting part of a Pub/Sub.
SubscribeInitializer is used to initialize subscribers.
Subscriber is the consuming part of the Pub/Sub.

# Type aliases

HandlerFunc is function called when message is received.
HandlerMiddleware allows us to write something like decorators to HandlerFunc.
Messages is a slice of messages.
Metadata is sent with every message to provide extra context without unmarshaling the message payload.
NoPublishHandlerFunc is HandlerFunc alternative, which doesn't produce any messages.
Payload is the Message's payload.
PublisherDecorator wraps the underlying Publisher, adding some functionality.
RouterPlugin is function which is executed on Router start.
SubscriberDecorator wraps the underlying Subscriber, adding some functionality.