Documentation
¶
Overview ¶
Package uow provides a GORM-backed implementation of libuow.Manager and libuow.UnitOfWork.
Use NewManager to create a transaction manager scoped to a set of repositories. Each call to GormManager.Begin opens a new database transaction and returns the repository bundle constructed by the supplied build function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GormManager ¶
type GormManager[T any] struct { // contains filtered or unexported fields }
GormManager is the GORM implementation of libuow.Manager. Build is called once per [Begin] with the transaction-scoped *gorm.DB; it should construct all repository instances for that transaction.
func NewManager ¶
NewManager creates a GormManager. build receives a transaction *gorm.DB on each Begin call and must return the module's repository bundle.
func (*GormManager[T]) Begin ¶
func (m *GormManager[T]) Begin(ctx context.Context) (libuow.UnitOfWork[T], error)