Documentation ¶
Index ¶
- type Custom
- type Dispatcher
- func (d *Dispatcher) Dispatch(ctx context.Context, event interfaces.IncomingEventInterface, ...) interfaces.ErrorInterface
- func (d *Dispatcher) GetErrors() []interfaces.ErrorInterface
- func (d *Dispatcher) OnError(ctx context.Context, evt interfaces.IncomingEventInterface, ...)
- func (d *Dispatcher) SetDelayer(delayer interfaces.DispatchDelayerInterface)
- func (d *Dispatcher) SetErrorHandler(handler interfaces.ErrorHandlerInterface)
- func (d *Dispatcher) SetFilters(filters []destination_filters.DestinationFilterInterface)
- func (d *Dispatcher) SetMiddlewares(middlewares []destination_filters.DestinationMiddlewareInterface)
- func (d *Dispatcher) TriggerErrorHandler(ctx context.Context, err *captin_errors.DispatcherError)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Custom ¶
type Custom struct{}
func (Custom) Sift ¶
func (c Custom) Sift(ctx context.Context, e *models.IncomingEvent, destinations []models.Destination, filters []destination_filters.DestinationFilterInterface, middlewares []destination_filters.DestinationMiddlewareInterface) []models.Destination
Sift - Custom check will filter ineligible destination
type Dispatcher ¶
type Dispatcher struct { Errors []interfaces.ErrorInterface // contains filtered or unexported fields }
Dispatcher - Event Dispatcher
func NewDispatcherWithDestinations ¶
func NewDispatcherWithDestinations( destinations []models.Destination, senderMapping map[string]interfaces.EventSenderInterface) *Dispatcher
NewDispatcherWithDestinations - Create Outgoing event dispatcher with destinations
func (*Dispatcher) Dispatch ¶
func (d *Dispatcher) Dispatch( ctx context.Context, event interfaces.IncomingEventInterface, store interfaces.StoreInterface, throttler interfaces.ThrottleInterface, documentStoreMappings map[string]interfaces.DocumentStoreInterface, ) interfaces.ErrorInterface
Dispatch - Dispatch an event to outgoing webhook NOTE: This function should not be called more than once, as it alters the object state (e.g. errors, caches) Subsequence calls should construct a new instance of Dispatcher.
func (*Dispatcher) GetErrors ¶
func (d *Dispatcher) GetErrors() []interfaces.ErrorInterface
func (*Dispatcher) OnError ¶
func (d *Dispatcher) OnError(ctx context.Context, evt interfaces.IncomingEventInterface, err interfaces.ErrorInterface)
func (*Dispatcher) SetDelayer ¶
func (d *Dispatcher) SetDelayer(delayer interfaces.DispatchDelayerInterface)
func (*Dispatcher) SetErrorHandler ¶
func (d *Dispatcher) SetErrorHandler(handler interfaces.ErrorHandlerInterface)
func (*Dispatcher) SetFilters ¶
func (d *Dispatcher) SetFilters(filters []destination_filters.DestinationFilterInterface)
SetFilters - Add filters before dispatch
func (*Dispatcher) SetMiddlewares ¶
func (d *Dispatcher) SetMiddlewares(middlewares []destination_filters.DestinationMiddlewareInterface)
func (*Dispatcher) TriggerErrorHandler ¶
func (d *Dispatcher) TriggerErrorHandler(ctx context.Context, err *captin_errors.DispatcherError)
Click to show internal directories.
Click to hide internal directories.