Versions in this module Expand all Collapse all v4 v4.0.0 Sep 11, 2023 Changes in this version + var ErrBatchSizeOutOfRange = errors.New("invalid batch size") + var PartitionKeyAlgorithm = partitionKey + var PublishRetryAttempts uint = 3 + var PublishRetryDelay = time.Second + var TableName = "outbox_messages" + type BatchSize uint + func (b BatchSize) Valid() error + type EventRepository interface + Fetch func(ctx context.Context, delay time.Duration, batchSize BatchSize) <-chan Message + MarkConsumed func(ctx context.Context, msg Message) error + type GormPersister struct + func NewGormPersister(db *gorm.DB) *GormPersister + func (r *GormPersister) PersistInTx(fn func(tx *gorm.DB) ([]Message, error)) error + type GormRepository struct + func NewGormRepository(db *gorm.DB) *GormRepository + func (r *GormRepository) Fetch(ctx context.Context, delay time.Duration, batchSize BatchSize) <-chan Message + func (r *GormRepository) MarkConsumed(ctx context.Context, msg Message) error + type GormTestSuite struct + func (suite *GormTestSuite) SetupTest() + type Message struct + Consumed bool + CreatedAt time.Time + EventType string + Exchange string + ID string + PartitionKey sql.NullInt64 + Payload interface{} + RoutingKey string + func GenerateMessages(n int) []Message + func NewMessage(id string, eventType string, payload interface{}, ...) Message + func (m *Message) BytePayload() ([]byte, error) + type PartitionKeyAlg func(s string) int + type PgxPersister struct + func NewPgxPersister(db *pgxpool.Pool) *PgxPersister + func (r *PgxPersister) PersistInTx(ctx context.Context, fn func(tx pgx.Tx) ([]Message, error)) error + type PgxRepository struct + func NewPgxOutboxRepository(db *pgxpool.Pool) *PgxRepository + func (r *PgxRepository) Fetch(ctx context.Context, delay time.Duration, batchSize BatchSize) <-chan Message + func (r *PgxRepository) MarkConsumed(ctx context.Context, msg Message) error + type PgxTestSuite struct + func (suite *PgxTestSuite) SetupTest() + func (suite *PgxTestSuite) TearDownSuite() + type Publisher interface + Publish func(exchange, topic string, message Message) error + type PublisherMock struct + Published []Message + func (p *PublisherMock) Publish(exchange, topic string, message Message) error + type Relay struct + func NewRelay(repo EventRepository, publisher Publisher, partitions int, ...) *Relay + func (r *Relay) Run(ctx context.Context, batchSize BatchSize) error + type RepositoryMock struct + Consumed []string + Cursor int + Messages []Message + func (m *RepositoryMock) Fetch(ctx context.Context, delay time.Duration, batchSize BatchSize) <-chan Message + func (m *RepositoryMock) MarkConsumed(ctx context.Context, msg Message) error + type TestSuite struct + func (suite *TestSuite) SetupTest() + func (suite *TestSuite) TearDownSuite() Other modules containing this package github.com/vsvp21/outbox github.com/vsvp21/outbox/v2 github.com/vsvp21/outbox/v3 github.com/vsvp21/outbox/v5