transaction

package
v0.0.0-...-45a04b4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory interface {
	// NewTxn creates a new transaction object for database operations.
	NewTxn(ctx context.Context) (Txn, error)
}

Factory represents a transaction factory object.

type Txn

type Txn interface {
	// Prepare prepares an SQL statement to be executed.
	Prepare(query string) (*sql.Stmt, error)
	// Commit commits the transaction.
	Commit() error
	// Rollback aborts the transaction.
	Rollback() error
}

Txn represents a transaction interface that provides atomic SQL database and queue operations.

Jump to

Keyboard shortcuts

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