Documentation
¶
Overview ¶
Package txgroup provides a simple way of handling multiple transactions as if they were a single one, helping to propagate, cancel and execute them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
NewContext returns a new context with the transactions stored in it.
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group manages a group of transactions.
func WithContext ¶
WithContext returns a transactions group containing a context with all the transactions stored in it.
type Tx ¶
type Tx interface {
// Commit commits the transaction.
Commit() error
// Rollback aborts the transaction.
Rollback() error
// Key returns the transaction identifier,
// it should be unique among the objects satisfying Tx.
Key() string
// Weight returns an integer representation of the priority in which the
// transaction should be executed.
Weight() uint
}
Tx represents a database transaction.
Click to show internal directories.
Click to hide internal directories.