outboxcore

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPending    = "pending"
	StatusPublishing = "publishing"
	StatusPublished  = "published"
	StatusFailed     = "failed"

	DefaultPublishingStaleFor       = time.Minute
	DefaultRelayRetryDelay          = 10 * time.Second
	DefaultDecodeFailureRetryDelay  = 10 * time.Second
	DefaultFailedTransitionAttempts = 1
)

Variables

This section is empty.

Functions

func BuildStatusSnapshot

func BuildStatusSnapshot(store string, now time.Time, observations []StatusObservation) outbox.StatusSnapshot

func DecodePendingEvent

func DecodePendingEvent(eventID, payloadJSON string, decoders ...eventcodec.PayloadDecoder) (outbox.PendingEvent, error)

func UnfinishedStatuses

func UnfinishedStatuses() []string

Types

type BuildRecordsOptions

type BuildRecordsOptions struct {
	Events   []event.DomainEvent
	Resolver eventcatalog.TopicResolver
	Encoder  eventcodec.PayloadEncoder
	Now      time.Time
}

type FailedTransition

type FailedTransition struct {
	Status           string
	LastError        string
	NextAttemptAt    time.Time
	UpdatedAt        time.Time
	AttemptIncrement int
}

func NewDecodeFailureTransition

func NewDecodeFailureTransition(decodeErr error, now time.Time) FailedTransition

func NewFailedTransition

func NewFailedTransition(lastError string, nextAttemptAt, updatedAt time.Time) FailedTransition

type PublishedTransition

type PublishedTransition struct {
	Status      string
	PublishedAt time.Time
	UpdatedAt   time.Time
}

func NewPublishedTransition

func NewPublishedTransition(publishedAt time.Time) PublishedTransition

type Record

type Record struct {
	EventID       string
	EventType     string
	AggregateType string
	AggregateID   string
	TopicName     string
	PayloadJSON   string
	Status        string
	AttemptCount  int
	NextAttemptAt time.Time
	CreatedAt     time.Time
	UpdatedAt     time.Time
}

func BuildRecords

func BuildRecords(opts BuildRecordsOptions) ([]Record, error)

type StatusObservation

type StatusObservation struct {
	Status          string
	Count           int64
	OldestCreatedAt *time.Time
}

Jump to

Keyboard shortcuts

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