Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var UUIDRegexp = regexp.MustCompile("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}")
UUIDRegexp enables to check if a string matches a UUID
Functions ¶
This section is empty.
Types ¶
type MessageQueueHandler ¶
type MessageQueueHandler interface {
HandleMessage(queueMsg []queueConsumer.Message)
}
MessageQueueHandler is a generic interface for implementation of components to hendle messages form the kafka queue.
func NewMessageQueueHandler ¶
func NewMessageQueueHandler(whitelist *regexp.Regexp, mapper NotificationMapper, dispatcher dispatcher.Dispatcher) MessageQueueHandler
NewMessageQueueHandler returns a new message handler
type NotificationMapper ¶
NotificationMapper maps CmsPublicationEvents to Notifications
func (NotificationMapper) MapNotification ¶
func (n NotificationMapper) MapNotification(event PublicationEvent, transactionID string) (dispatcher.Notification, error)
MapNotification maps the given event to a new notification.
type NotificationQueueMessage ¶
type NotificationQueueMessage struct {
queueConsumer.Message
}
NotificationQueueMessage is a wrapper for the queue consumer message type
func (NotificationQueueMessage) HasCarouselTransactionID ¶
func (msg NotificationQueueMessage) HasCarouselTransactionID() bool
HasCarouselTransactionID checks if the message is genearted by the publish carousel
func (NotificationQueueMessage) HasSynthTransactionID ¶
func (msg NotificationQueueMessage) HasSynthTransactionID() bool
HasSynthTransactionID checks if the message is synthetic
func (NotificationQueueMessage) ToPublicationEvent ¶
func (msg NotificationQueueMessage) ToPublicationEvent() (event PublicationEvent, err error)
ToPublicationEvent converts the message to a CmsPublicationEvent
func (NotificationQueueMessage) TransactionID ¶
func (msg NotificationQueueMessage) TransactionID() string
TransactionID returns the message TID
type PublicationEvent ¶
type PublicationEvent struct { ContentURI string UUID string Payload interface{} LastModified string }
PublicationEvent is the data structure that represents a publication event consumed from Kafka
func (PublicationEvent) HasEmptyPayload ¶
func (e PublicationEvent) HasEmptyPayload() bool
HasEmptyPayload is a method that returns true if the PublicationEvent has an empty playload