db_context

package
v0.0.0-...-d3f7758 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package db_context dbContext provides a wrapper around db context handling to allow access to the db context without requiring importing the db package, thus avoiding cyclic imports

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transaction

func Transaction(ctx context.Context) (tx *transaction.Transaction, ok bool)

Transaction extracts the transaction value from the context

func TxID

func TxID(ctx context.Context) (id int64, ok bool)

Return the transaction ID from the context, if it exists. If there is no transaction, ok is false.

func WithTransaction

func WithTransaction(ctx context.Context, tx *transaction.Transaction) context.Context

WithTransaction adds the transaction to the context and returns a new context

Types

This section is empty.

Jump to

Keyboard shortcuts

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