Documentation ¶
Overview ¶
Package transaction provides support for database transaction related functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteUnderTransaction ¶
func ExecuteUnderTransaction(ctx context.Context, log *logger.Logger, bgn Beginner, fn func(tx Transaction) error) error
ExecuteUnderTransaction is a helper function that can be used in tests and other apps to execute the core APIs under a transaction.
Types ¶
type Beginner ¶
type Beginner interface {
Begin() (Transaction, error)
}
Beginner represents a value that can begin a transaction.
type Transaction ¶
Transaction represents a value that can commit or rollback a transaction.
Click to show internal directories.
Click to hide internal directories.