eventerrors

package
v2.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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

func (e *EventHandlerErrorRecorder) HandleEvent(ctx context.Context, event eh.Event) error

HandleEvent implements the HandleEvent method of the EventBus interface.

func (*EventHandlerErrorRecorder) HandlerType

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL