transactional_outbox

package
v0.0.0-...-35a4376 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DatabaseMigrations embed.FS

Functions

This section is empty.

Types

type Config

type Config struct {
	QueryTimeout       time.Duration
	TickerDuration     time.Duration
	ErrorMaxValue      int64
	QueryErrorMaxValue int64
	NumberOfWorkers    int64
	BatchSize          uint64
}

func DefaultConfig

func DefaultConfig() Config

func (Config) ValidateConfigFields

func (c Config) ValidateConfigFields() error

type Outbox

type Outbox[T any] struct {
	// contains filtered or unexported fields
}

func NewOutbox

func NewOutbox[T any](
	config Config,
	builder *squirrel_builder.Builder,
	logger log.Logger,
) (*Outbox[T], error)

func (*Outbox[T]) Close

func (o *Outbox[T]) Close() error

func (*Outbox[T]) SaveEvents

func (o *Outbox[T]) SaveEvents(
	txCtx squirrel_builder.TransactionContext,
	datas ...T,
) error

func (*Outbox[T]) SetProcessingFunction

func (o *Outbox[T]) SetProcessingFunction(processingFunction func(ctx context.Context, data T) error)

Jump to

Keyboard shortcuts

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