Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
func Add(ctx context.Context, message *sdk.EventHookMessage) error
enqueues a message to the event hooks service
func SetInstance ¶ added in v0.2.2
func SetInstance(i Queue)
Types ¶
type EventHooksProvider ¶
type EventHooksProvider interface { // Gets the subscriptions for an event type Get() ([]*data.EventHook, error) }
func NewEventHooksProvider ¶
func NewEventHooksProvider(db *gorm.DB) EventHooksProvider
type Publisher ¶
type Publisher interface { // publishes a message to all web hook subscriptions Publish(message *sdk.EventHookMessage) error }
Publishes event hook messages to all web hooks registered in the system.
func NewEventHookPublisher ¶
func NewEventHookPublisher(subscriptionsProvider EventHooksProvider) Publisher
type Queue ¶
type Queue interface { // adds a message to the hooks queue Add(ctx context.Context, message *sdk.EventHookMessage) error }
This implementation is to make the semantics clear that this is the lifecycle of a hook message: eventHookMessage --> added to queue --> received --> executed handler (events) --> publish the message using Publisher.Publish() queue for adding hook messages to be published
func NewEventHookQueue ¶
func NewEventHookQueue(messageSender messaging.MessageSender) Queue
Click to show internal directories.
Click to hide internal directories.