Documentation ¶
Index ¶
- Variables
- type HandlerFunc
- type HandlerMiddleware
- type Message
- type Messages
- type Metadata
- type Payload
- type PubSub
- type Publisher
- type Router
- func (r *Router) AddHandler(handlerName string, subscribeTopic string, publishTopic string, pubSub PubSub, ...) error
- func (r *Router) AddMiddleware(m ...HandlerMiddleware)
- func (r *Router) AddNoPublisherHandler(handlerName string, subscribeTopic string, subscriber Subscriber, ...) error
- func (r *Router) AddPlugin(p ...RouterPlugin)
- func (r *Router) Close() error
- func (r *Router) Logger() watermill.LoggerAdapter
- func (r *Router) Run() (err error)
- func (r *Router) Running() chan struct{}
- type RouterConfig
- type RouterPlugin
- type Subscriber
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyAcked = errors.New("message already acked") ErrAlreadyNacked = errors.New("message already nacked") )
Functions ¶
This section is empty.
Types ¶
type HandlerFunc ¶
type HandlerMiddleware ¶
type HandlerMiddleware func(h HandlerFunc) HandlerFunc
type Message ¶
type Message struct { UUID string // todo - change to []byte?, change to type Metadata Metadata Payload Payload // contains filtered or unexported fields }
func NewMessage ¶
type PubSub ¶
type PubSub interface { Close() error // contains filtered or unexported methods }
func NewPubSub ¶
func NewPubSub(publisher Publisher, subscriber Subscriber) PubSub
type Publisher ¶
type Publisher interface { Close() error // contains filtered or unexported methods }
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func NewRouter ¶
func NewRouter(config RouterConfig, logger watermill.LoggerAdapter) (*Router, error)
func (*Router) AddHandler ¶
func (*Router) AddMiddleware ¶
func (r *Router) AddMiddleware(m ...HandlerMiddleware)
AddMiddleware adds a new middleware to the router.
The order of middlewares matters. Middleware added at the beginning is executed first.
func (*Router) AddNoPublisherHandler ¶
func (r *Router) AddNoPublisherHandler( handlerName string, subscribeTopic string, subscriber Subscriber, handlerFunc HandlerFunc, ) error
func (*Router) AddPlugin ¶
func (r *Router) AddPlugin(p ...RouterPlugin)
func (*Router) Logger ¶
func (r *Router) Logger() watermill.LoggerAdapter
type RouterConfig ¶
func (RouterConfig) Validate ¶
func (c RouterConfig) Validate() error
type RouterPlugin ¶
type Subscriber ¶
type Subscriber interface { Close() error // contains filtered or unexported methods }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.