transaction

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// StartTransaction 开启新事务
	NewTransaction(enableTxn bool, h http.Header, opts ...metadata.TxnOption) (Transaction, error)
	// AutoRun is a transaction wrapper. it will automatically commit or abort the
	// transaction depend on the f(), if f() returns with an error, then abort the
	// transaction, otherwise, it will commit the transaction.
	AutoRunTxn(ctx context.Context, enableTxn bool, h http.Header, run func() error, opts ...metadata.TxnOption) error
}

Transaction interface

func NewTxn

func NewTxn(client rest.ClientInterface) Interface

type Transaction

type Transaction interface {
	// CommitTransaction is to commit the transaction.
	CommitTransaction(ctx context.Context, h http.Header) error
	// AbortTransaction is to abort the transaction.
	AbortTransaction(ctx context.Context, h http.Header) error
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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