dbcontext

package
v0.0.0-...-6dde671 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package dbcontext provides DB transaction support for transactions tha span method calls of multiple repositories and services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB represents a DB connection that can be used to run SQL queries.

func New

func New(db *mongo.Database) *DB

New returns a new DB connection that wraps the given dbx.DB instance.

func (*DB) DB

func (db *DB) DB() *mongo.Database

DB returns the dbx.DB wrapped by this object.

type TransactionFunc

type TransactionFunc func(ctx context.Context, f func(ctx context.Context) error) error

TransactionFunc represents a function that will start a transaction and run the given function.

Jump to

Keyboard shortcuts

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