uow

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package uow provides the UnitOfWork contract and its GORM transaction implementation, plus the context plumbing repositories use to join an ambient transaction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inject

func Inject(ctx context.Context, orm *gorm.DB) context.Context

func ORM

func ORM(ctx context.Context, fallback *gorm.DB) *gorm.DB

Types

type UnitOfWork

type UnitOfWork interface {
	Do(ctx context.Context, fn func(ctx context.Context) error) error
}

UnitOfWork wraps multiple repository operations in a single atomic transaction.

func New

func New(orm *gorm.DB) UnitOfWork

Jump to

Keyboard shortcuts

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