Documentation ¶
Index ¶
- Variables
- type Publisher
- type Router
- func (r *Router) AddHandler(handlerName, subscribeTopic, publishTopic string, ...) *message.Handler
- func (r *Router) AddNoPublisherHandler(handlerName, subscribeTopic string, handlerFunc message.NoPublishHandlerFunc) *message.Handler
- func (r *Router) Check() health.Check
- func (r *Router) Publisher() *Publisher
- func (r *Router) Subscriber() *Subscriber
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
var Module = fx.Options( fx.Provide(NewPublisher, NewSubscriber, NewRouter), )
Module exported to initialise a new Publisher, Subscriber and Router.
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher struct { *amqp.Publisher *gochannel.GoChannel // contains filtered or unexported fields }
Publisher is a wrapper for amqp.Publisher.
func NewPublisher ¶
func NewPublisher(cfg *config.Config, logger *logger.Logger, health *health.Checks) (*Publisher, error)
NewPublisher returns a new publisher.
func NewTestPublisher ¶
NewTestPublisher returns a new publisher for testing purposes.
func (*Publisher) MessagePublisher ¶
MessagePublisher returns the message publisher.
type Router ¶
Router is a wrapper for a message router.
func NewRouter ¶
func NewRouter( cfg *config.Config, publisher *Publisher, subscriber *Subscriber, logger *logger.Logger, health *health.Checks, ) (*Router, error)
NewRouter returns a new router.
func (*Router) AddHandler ¶
func (r *Router) AddHandler( handlerName, subscribeTopic, publishTopic string, handlerFunc message.HandlerFunc, ) *message.Handler
AddHandler is a wrapper around message.Router.AddHandler.
func (*Router) AddNoPublisherHandler ¶
func (r *Router) AddNoPublisherHandler( handlerName, subscribeTopic string, handlerFunc message.NoPublishHandlerFunc, ) *message.Handler
AddNoPublisherHandler is a wrapper around message.Router.AddNoPublisherHandler.
func (*Router) Subscriber ¶
func (r *Router) Subscriber() *Subscriber
Subscriber returns the subscriber for the router.
type Subscriber ¶
type Subscriber struct { *amqp.Subscriber *gochannel.GoChannel // contains filtered or unexported fields }
Subscriber is a wrapper for amqp.Subscriber.
func NewSubscriber ¶
func NewSubscriber(cfg *config.Config, logger *logger.Logger, health *health.Checks) (*Subscriber, error)
NewSubscriber returns a new subscriber.
func NewTestSubscriber ¶
func NewTestSubscriber(logger *logger.Logger) *Subscriber
NewTestSubscriber returns a new subscriber for testing purposes.
func (*Subscriber) Check ¶
func (s *Subscriber) Check() health.Check
Check is used to perform healthcheck.
func (*Subscriber) MessageSubscriber ¶
func (s *Subscriber) MessageSubscriber() message.Subscriber
MessageSubscriber returns the message subscriber.