Documentation ¶
Index ¶
- type EventError
- type EventHandlerErrorRecorder
- func (e *EventHandlerErrorRecorder) AddHandler(ctx context.Context, matcher eh.EventMatcher, handler eh.EventHandler) error
- func (e *EventHandlerErrorRecorder) Close() error
- func (e *EventHandlerErrorRecorder) Errors() <-chan error
- func (e *EventHandlerErrorRecorder) HandleEvent(ctx context.Context, event eh.Event) error
- func (e *EventHandlerErrorRecorder) HandlerType() eh.EventHandlerType
- type RetriableError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventError ¶
type EventError struct { Id ids.Id `bson:"_id"` CreatedAt time.Time `bson:"createdAt"` UserId *ids.Id `bson:"userId"` // The user that caused the error, if present Tenant *string `bson:"tenant"` // The tenant that caused the error, if present Err string `bson:"error"` // The error returned by the event handler Event eh.Event `bson:"event"` // The event that caused the error Host string `bson:"host"` // This is the machine name }
func (EventError) EntityID ¶
func (e EventError) EntityID() uuid.UUID
type EventHandlerErrorRecorder ¶
type EventHandlerErrorRecorder struct {
// contains filtered or unexported fields
}
EventHandlerErrorRecorder is a wrapper to a EventHandler to catch the returned errors from a target event handler, and record them to process them.
func NewEventHandlerErrorRecorder ¶
func NewEventHandlerErrorRecorder(logger *zap.Logger, client *mongo.Client, databaseName, collectionName string, target eh.EventBus) (*EventHandlerErrorRecorder, error)
NewEventHandlerErrorRecorder returns a new instance of EventHandlerErrorRecorder using the mongo client to record the events in the indicated database and collection.
func (*EventHandlerErrorRecorder) AddHandler ¶
func (e *EventHandlerErrorRecorder) AddHandler(ctx context.Context, matcher eh.EventMatcher, handler eh.EventHandler) error
AddHandler implements the AddHandler method of the EventBus interface.
func (*EventHandlerErrorRecorder) Close ¶
func (e *EventHandlerErrorRecorder) Close() error
Close implements the Close method of the EventBus interface.
func (*EventHandlerErrorRecorder) Errors ¶
func (e *EventHandlerErrorRecorder) Errors() <-chan error
Errors implements the Errors method of the EventBus interface.
func (*EventHandlerErrorRecorder) HandleEvent ¶
HandleEvent implements the HandleEvent method of the EventBus interface.
func (*EventHandlerErrorRecorder) HandlerType ¶
func (e *EventHandlerErrorRecorder) HandlerType() eh.EventHandlerType
HandlerType implements the HandlerType method of the EventBus interface.
type RetriableError ¶
type RetriableError interface {
IsRetriable() bool
}
RetriableError is a marker to identify an error that can be retried.