modulepackage
0.0.0-20240723120019-d7e638a790db
Repository: https://github.com/tangelo-labs/go-outbox.git
Documentation: pkg.go.dev
# README
Outbox
Gorm Example
Workaround for resolving *sql.Tx
from Gorm *gorm.DB
:
err := gorm.DB.Transaction(func(tx *gorm.DB) error {
pool := tx.Statement.ConnPool
store.SaveTx(ctx, pool.(*sql.Tx), &outbox.Event{...})
})
Testing
The package includes a test suite that you can run with the go test
command:
go test ./...
Contributing
Contributions to go-outbox
are welcome. Please submit a pull request or create an issue to discuss the changes you want to make.
License
go-outbox
is licensed under the MIT License. See the LICENSE
file for more information.
# Functions
NewWorker builds a new worker instance.
# Interfaces
EventStore is responsible for storing and retrieving events.
Worker is responsible for periodically retrieving pending events from an event store dispatching them.
# Type aliases
DispatchFunc is a function that is called for each event that is retrieved from the event store that has not been dispatched yet.