outbox

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusProcessing = "PROCESSING"
	StatusSent       = "SENT"
)

Variables

This section is empty.

Functions

func NewOutboxModule

func NewOutboxModule() fx.Option

Types

type Config

type Config struct {
	// MaxBackoff is the maximum delay between retry attempts.
	// Default: 10 hours
	MaxBackoff time.Duration `mapstructure:"max-backoff"`
}

type Message

type Message struct {
	Payload any               // The actual message payload to be sent
	EventID string            // Unique event identifier - used as outbox record ID for idempotency (prevents duplicate messages)
	Key     string            // Kafka partition key for ordering guarantees
	Headers map[string]string // Kafka headers for trace propagation, event_type, etc.
}

type Outbox

type Outbox interface {
	Create(ctx context.Context, msg Message) (SendFunc, error)
}

type SendFunc

type SendFunc func(ctx context.Context) error

Jump to

Keyboard shortcuts

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