transactor

package
v0.0.0-...-c52fe67 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTransactionHandlerNotFound = errors.New("transaction handler not found")

Functions

This section is empty.

Types

type Handler

type Handler interface {
	sql.Handler
	sql.TransactionBeginner
}

type Store

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

func (*Store) Commit

func (ts *Store) Commit(ctx context.Context) error

func (*Store) GetHandler

func (ts *Store) GetHandler(ctx context.Context, handler Handler) (sql.Handler, bool, error)

func (*Store) RollBack

func (ts *Store) RollBack(ctx context.Context) error

type Transactor

type Transactor struct {
	TransactorStore *Store
}

func New

func New() *Transactor

func (*Transactor) GetStore

func (h *Transactor) GetStore() *Store

func (*Transactor) Transact

func (h *Transactor) Transact(ctx context.Context, txFunc func(tx context.Context) error) (err error)

Jump to

Keyboard shortcuts

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