Documentation
¶
Index ¶
- func CreateTableSQL(tableName string) string
- type Config
- type Option
- type OptionFunc
- type Store
- func (s *Store) FetchPending(ctx context.Context, limit int) ([]outbox.Message, error)
- func (s *Store) MarkFailed(ctx context.Context, id string, err error) error
- func (s *Store) MarkProcessed(ctx context.Context, ids ...string) error
- func (s *Store) Save(ctx context.Context, tx any, msgs ...outbox.Message) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTableSQL ¶
CreateTableSQL returns the DDL for creating the outbox messages table.
Types ¶
type Option ¶
type Option interface {
Apply(*Config)
}
An Option configures a Store instance.
func WithMaxRetries ¶
WithMaxRetries sets the maximum number of retries before a message is marked as failed.
func WithRetryAfter ¶
WithRetryAfter sets the duration after which a failed message is retried.
type OptionFunc ¶
type OptionFunc func(*Config)
OptionFunc is a function that configures a Store config.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements outbox.Store using PostgreSQL.
func (*Store) FetchPending ¶
FetchPending atomically claims up to limit pending messages for processing.
func (*Store) MarkFailed ¶
MarkFailed increments retries and records the error.
func (*Store) MarkProcessed ¶
MarkProcessed marks messages as successfully processed.
Click to show internal directories.
Click to hide internal directories.