mongo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const EventCollection = "events"

Variables

This section is empty.

Functions

func NewEventRepository

func NewEventRepository(ctx context.Context, db *mongo.Database, dequeueTimeout time.Duration, runningTimeout time.Duration) (eventbus.EventRepository, error)

Types

type Event

type Event struct {
	EventID string `json:"id" bson:"id"`
	Type    string `json:"type" bson:"type"`
	Status  string `json:"status" bson:"status"`
	// todo record reason why in current status
	Reason      string              `bson:"reason" bson:"reason"`
	Payload     string              `json:"payload" bson:"payload"`
	RetryCount  int                 `json:"retryCount" bson:"retryCount"`
	CreatedAt   primitive.DateTime  `json:"createdAt" bson:"createdAt"`
	UpdatedAt   primitive.DateTime  `json:"updatedAt" bson:"updatedAt"`
	ScheduledAt primitive.DateTime  `json:"scheduledAt" bson:"scheduledAt"`
	DeletedAt   *primitive.DateTime `json:"deletedAt" bson:"deletedAt"`
}

Event represents an event to be processed

Jump to

Keyboard shortcuts

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