Documentation ¶
Index ¶
- Variables
- type ConceptAnnotationsEvent
- type ContentQueueHandler
- type MessageQueueHandler
- type MessageQueueRouter
- type MetadataQueueHandler
- type NotificationMapper
- type NotificationQueueMessage
- func (msg NotificationQueueMessage) HasCarouselTransactionID() bool
- func (msg NotificationQueueMessage) HasSynthTransactionID() bool
- func (msg NotificationQueueMessage) OriginID() string
- func (msg NotificationQueueMessage) ToAnnotationEvent() (ConceptAnnotationsEvent, error)
- func (msg NotificationQueueMessage) ToPublicationEvent() (event PublicationEvent, err error)
- func (msg NotificationQueueMessage) TransactionID() string
- type PropertyReader
- type PublicationEvent
- type Set
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 ConceptAnnotationsEvent ¶ added in v4.1.0
type ContentQueueHandler ¶ added in v4.2.1
type ContentQueueHandler struct {
// contains filtered or unexported fields
}
func NewContentQueueHandler ¶ added in v4.1.0
func NewContentQueueHandler(contentURIWhitelist *regexp.Regexp, contentTypeWhitelist *Set, mapper NotificationMapper, dispatcher notificationDispatcher, log *logger.UPPLogger) *ContentQueueHandler
NewContentQueueHandler returns a new message handler
func (*ContentQueueHandler) HandleMessage ¶ added in v4.2.1
func (qHandler *ContentQueueHandler) HandleMessage(queueMsg kafka.FTMessage) error
type MessageQueueHandler ¶
MessageQueueHandler is a generic interface for implementation of components to handle messages form the kafka queue.
type MessageQueueRouter ¶ added in v4.1.0
type MessageQueueRouter struct {
// contains filtered or unexported fields
}
func NewMessageQueueHandler ¶
func NewMessageQueueHandler(contentHandler, metadataHandler MessageQueueHandler) *MessageQueueRouter
func (*MessageQueueRouter) HandleMessage ¶ added in v4.1.0
func (h *MessageQueueRouter) HandleMessage(queueMsg kafka.FTMessage) error
type MetadataQueueHandler ¶ added in v4.2.1
type MetadataQueueHandler struct {
// contains filtered or unexported fields
}
func NewMetadataQueueHandler ¶ added in v4.1.0
func NewMetadataQueueHandler(originWhitelist []string, mapper NotificationMapper, dispatcher notificationDispatcher, log *logger.UPPLogger) *MetadataQueueHandler
func (*MetadataQueueHandler) HandleMessage ¶ added in v4.2.1
func (h *MetadataQueueHandler) HandleMessage(queueMsg kafka.FTMessage) error
func (*MetadataQueueHandler) IsAllowedOrigin ¶ added in v4.2.1
func (h *MetadataQueueHandler) IsAllowedOrigin(origin string) bool
type NotificationMapper ¶
type NotificationMapper struct { APIBaseURL string Resource string Property PropertyReader }
NotificationMapper maps CmsPublicationEvents to Notifications
func (NotificationMapper) MapMetadataNotification ¶ added in v4.1.0
func (n NotificationMapper) MapMetadataNotification(event ConceptAnnotationsEvent, transactionID string) dispatch.Notification
func (NotificationMapper) MapNotification ¶
func (n NotificationMapper) MapNotification(event PublicationEvent, transactionID string) (dispatch.Notification, error)
MapNotification maps the given event to a new notification.
type NotificationQueueMessage ¶
NotificationQueueMessage is a wrapper for the queue consumer message type
func (NotificationQueueMessage) HasCarouselTransactionID ¶
func (msg NotificationQueueMessage) HasCarouselTransactionID() bool
HasCarouselTransactionID checks if the message is generated by the publish carousel
func (NotificationQueueMessage) HasSynthTransactionID ¶
func (msg NotificationQueueMessage) HasSynthTransactionID() bool
HasSynthTransactionID checks if the message is synthetic
func (NotificationQueueMessage) OriginID ¶ added in v4.1.0
func (msg NotificationQueueMessage) OriginID() string
func (NotificationQueueMessage) ToAnnotationEvent ¶ added in v4.1.0
func (msg NotificationQueueMessage) ToAnnotationEvent() (ConceptAnnotationsEvent, error)
ToAnnotationEvent converts message to ConceptAnnotations Event
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 PropertyReader ¶ added in v4.1.0
type PropertyReader interface {
LastModified(event ConceptAnnotationsEvent) string
}
type PublicationEvent ¶
type PublicationEvent struct { ContentURI string ContentTypeHeader string LastModified string Payload interface{} UUID 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 payload