package tx

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/tx"

Index

Constants

const (
	LazyTxID = "LAZY_TX"
)

Types

type Identifier

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

type LazyID

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

func ID

func ID(id string) LazyID

func (LazyID) ID

func (id LazyID) ID() string

func (*LazyID) SetTxID

func (id *LazyID) SetTxID(txID string)

type OnTransactionBeforeCommit

type OnTransactionBeforeCommit func(ctx context.Context) error

type OnTransactionCompletedFunc

type OnTransactionCompletedFunc func(transactionResult error)

type Transaction

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

func AsTransaction(id Identifier) (Transaction, error)

Source Files

id.go transaction.go

Version
v3.93.3
Published
Dec 5, 2024
Platform
darwin/amd64
Imports
3 packages
Last checked
4 minutes ago

Tools for package owners.