tx

package
v3.95.5 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LazyTxID = "LAZY_TX"
	FakeTxID = "FAKE_TX"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Identifier

type Identifier interface {
	ID() string
	// contains filtered or unexported methods
}

type LazyID added in v3.80.3

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

func ID

func ID(id string) LazyID

func (LazyID) ID added in v3.80.3

func (id LazyID) ID() string

func (*LazyID) SetTxID added in v3.80.3

func (id *LazyID) SetTxID(txID string)

type OnTransactionBeforeCommit added in v3.81.0

type OnTransactionBeforeCommit func(ctx context.Context) error

type OnTransactionCompletedFunc added in v3.76.4

type OnTransactionCompletedFunc func(transactionResult error)

type Transaction added in v3.76.4

type Transaction interface {
	Identifier
	UnLazy(ctx context.Context) error
	SessionID() string

	// OnBeforeCommit add callback, which will be called before commit transaction
	// the method will be not call the method if some error happen and transaction will not be committed
	OnBeforeCommit(f OnTransactionBeforeCommit)
	OnCompleted(f OnTransactionCompletedFunc)
	Rollback(ctx context.Context) error
}

func AsTransaction added in v3.76.4

func AsTransaction(id Identifier) (Transaction, error)

Jump to

Keyboard shortcuts

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