eventerrors

package
v2.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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       error     `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