Documentation ¶
Index ¶
- Constants
- type BufferedEmitter
- type Event
- func CollectionContentUnitsChangeEvent(c *models.Collection) Event
- func CollectionCreateEvent(c *models.Collection) Event
- func CollectionDeleteEvent(c *models.Collection) Event
- func CollectionPublishedChangeEvent(c *models.Collection) Event
- func CollectionUpdateEvent(c *models.Collection) Event
- func ContentUnitCreateEvent(cu *models.ContentUnit) Event
- func ContentUnitDeleteEvent(cu *models.ContentUnit) Event
- func ContentUnitDerivativesChangeEvent(cu *models.ContentUnit) Event
- func ContentUnitPersonsChangeEvent(cu *models.ContentUnit) Event
- func ContentUnitPublishedChangeEvent(cu *models.ContentUnit) Event
- func ContentUnitPublishersChangeEvent(cu *models.ContentUnit) Event
- func ContentUnitSourcesChangeEvent(cu *models.ContentUnit) Event
- func ContentUnitTagsChangeEvent(cu *models.ContentUnit) Event
- func ContentUnitUpdateEvent(cu *models.ContentUnit) Event
- func FileInsertEvent(f *models.File, insertType string) Event
- func FilePublishedEvent(f *models.File) Event
- func FileRemoveEvent(f *models.File) Event
- func FileReplaceEvent(oldFile *models.File, newFile *models.File, insertType string) Event
- func FileUpdateEvent(f *models.File) Event
- func PersonCreateEvent(p *models.Person) Event
- func PersonDeleteEvent(p *models.Person) Event
- func PersonUpdateEvent(p *models.Person) Event
- func PublisherCreateEvent(p *models.Publisher) Event
- func PublisherUpdateEvent(p *models.Publisher) Event
- func SourceCreateEvent(s *models.Source) Event
- func SourceUpdateEvent(s *models.Source) Event
- func TagCreateEvent(t *models.Tag) Event
- func TagUpdateEvent(t *models.Tag) Event
- type EventEmitter
- type EventHandler
- type LoggerEventHandler
- type NatsStreamingEventHandler
- type NoopEmitter
Constants ¶
View Source
const ( E_COLLECTION_CREATE = "COLLECTION_CREATE" E_COLLECTION_UPDATE = "COLLECTION_UPDATE" E_COLLECTION_DELETE = "COLLECTION_DELETE" E_COLLECTION_PUBLISHED_CHANGE = "COLLECTION_PUBLISHED_CHANGE" E_COLLECTION_CONTENT_UNITS_CHANGE = "COLLECTION_CONTENT_UNITS_CHANGE" E_CONTENT_UNIT_CREATE = "CONTENT_UNIT_CREATE" E_CONTENT_UNIT_UPDATE = "CONTENT_UNIT_UPDATE" E_CONTENT_UNIT_DELETE = "CONTENT_UNIT_DELETE" E_CONTENT_UNIT_PUBLISHED_CHANGE = "CONTENT_UNIT_PUBLISHED_CHANGE" E_CONTENT_UNIT_DERIVATIVES_CHANGE = "CONTENT_UNIT_DERIVATIVES_CHANGE" E_CONTENT_UNIT_SOURCES_CHANGE = "CONTENT_UNIT_SOURCES_CHANGE" E_CONTENT_UNIT_TAGS_CHANGE = "CONTENT_UNIT_TAGS_CHANGE" E_CONTENT_UNIT_PERSONS_CHANGE = "CONTENT_UNIT_PERSONS_CHANGE" E_CONTENT_UNIT_PUBLISHERS_CHANGE = "CONTENT_UNIT_PUBLISHERS_CHANGE" E_FILE_UPDATE = "FILE_UPDATE" E_FILE_PUBLISHED = "FILE_PUBLISHED" E_FILE_INSERT = "FILE_INSERT" E_FILE_REPLACE = "FILE_REPLACE" E_FILE_REMOVE = "FILE_REMOVE" E_SOURCE_CREATE = "SOURCE_CREATE" E_SOURCE_UPDATE = "SOURCE_UPDATE" E_TAG_CREATE = "TAG_CREATE" E_TAG_UPDATE = "TAG_UPDATE" E_PERSON_CREATE = "PERSON_CREATE" E_PERSON_UPDATE = "PERSON_UPDATE" E_PERSON_DELETE = "PERSON_DELETE" E_PUBLISHER_CREATE = "PUBLISHER_CREATE" E_PUBLISHER_UPDATE = "PUBLISHER_UPDATE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedEmitter ¶
type BufferedEmitter struct {
// contains filtered or unexported fields
}
func NewBufferedEmitter ¶
func NewBufferedEmitter(size int, handlers ...EventHandler) (*BufferedEmitter, error)
func (*BufferedEmitter) Emit ¶
func (e *BufferedEmitter) Emit(events ...Event)
func (*BufferedEmitter) Shutdown ¶
func (e *BufferedEmitter) Shutdown()
type Event ¶
type Event struct { ID string `json:"id"` Type string `json:"type"` ReplicationLocation string `json:"rloc"` Payload map[string]interface{} `json:"payload"` }
func CollectionContentUnitsChangeEvent ¶
func CollectionContentUnitsChangeEvent(c *models.Collection) Event
func CollectionCreateEvent ¶
func CollectionCreateEvent(c *models.Collection) Event
func CollectionDeleteEvent ¶
func CollectionDeleteEvent(c *models.Collection) Event
func CollectionPublishedChangeEvent ¶
func CollectionPublishedChangeEvent(c *models.Collection) Event
func CollectionUpdateEvent ¶
func CollectionUpdateEvent(c *models.Collection) Event
func ContentUnitCreateEvent ¶
func ContentUnitCreateEvent(cu *models.ContentUnit) Event
func ContentUnitDeleteEvent ¶ added in v1.0.0
func ContentUnitDeleteEvent(cu *models.ContentUnit) Event
func ContentUnitDerivativesChangeEvent ¶
func ContentUnitDerivativesChangeEvent(cu *models.ContentUnit) Event
func ContentUnitPersonsChangeEvent ¶
func ContentUnitPersonsChangeEvent(cu *models.ContentUnit) Event
func ContentUnitPublishedChangeEvent ¶
func ContentUnitPublishedChangeEvent(cu *models.ContentUnit) Event
func ContentUnitPublishersChangeEvent ¶ added in v0.9.2
func ContentUnitPublishersChangeEvent(cu *models.ContentUnit) Event
func ContentUnitSourcesChangeEvent ¶
func ContentUnitSourcesChangeEvent(cu *models.ContentUnit) Event
func ContentUnitTagsChangeEvent ¶
func ContentUnitTagsChangeEvent(cu *models.ContentUnit) Event
func ContentUnitUpdateEvent ¶
func ContentUnitUpdateEvent(cu *models.ContentUnit) Event
func FilePublishedEvent ¶
func FileRemoveEvent ¶ added in v1.0.1
func FileReplaceEvent ¶
func FileUpdateEvent ¶
func PersonCreateEvent ¶
func PersonDeleteEvent ¶ added in v0.9.2
func PersonUpdateEvent ¶
func PublisherCreateEvent ¶ added in v0.9.2
func PublisherUpdateEvent ¶ added in v0.9.2
func SourceCreateEvent ¶
func SourceUpdateEvent ¶
func TagCreateEvent ¶
func TagUpdateEvent ¶
type EventEmitter ¶
type EventEmitter interface {
Emit(...Event)
}
type EventHandler ¶
type EventHandler interface {
Handle(Event)
}
type LoggerEventHandler ¶
type LoggerEventHandler struct{}
func (*LoggerEventHandler) Handle ¶
func (eh *LoggerEventHandler) Handle(event Event)
type NatsStreamingEventHandler ¶
type NatsStreamingEventHandler struct {
// contains filtered or unexported fields
}
func NewNatsStreamingEventHandler ¶
func NewNatsStreamingEventHandler(subject, clusterID, clientID string, options ...stan.Option) (*NatsStreamingEventHandler, error)
func (*NatsStreamingEventHandler) Close ¶
func (eh *NatsStreamingEventHandler) Close() error
func (*NatsStreamingEventHandler) Handle ¶
func (eh *NatsStreamingEventHandler) Handle(event Event)
type NoopEmitter ¶
type NoopEmitter struct{}
func (*NoopEmitter) Emit ¶
func (e *NoopEmitter) Emit(event ...Event)
Click to show internal directories.
Click to hide internal directories.