transaction_context

package
v0.0.0-...-35a4376 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IsolationLevel

type IsolationLevel int
const (
	LevelDefault IsolationLevel = iota
	LevelReadUncommitted
	LevelReadCommitted
	LevelWriteCommitted
	LevelRepeatableRead
	LevelSnapshot
	LevelSerializable
	LevelLinearizable
)

type TransactionContext

type TransactionContext interface {
	context.Context

	Commit() error
	Rollback() error
}

type TransactionStarter

type TransactionStarter interface {
	BeginTransaction(ctx context.Context, opts ...TxOptions) (TransactionContext, error)

	ExecuteWithCommit(ctx context.Context, transactionFunction func(TransactionContext) error, opts ...TxOptions) error
}

type TxOptions

type TxOptions struct {
	Isolation IsolationLevel
	ReadOnly  bool
}

Jump to

Keyboard shortcuts

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