Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDiscarded is returned if the transaction was already discarded or committed. ErrDiscarded = errors.New("transaction has already been discarded or committed") // ErrNotWrite is returned if the transaction is read only. ErrNotWrite = errors.New("transaction is read-only") )
Functions ¶
This section is empty.
Types ¶
type Tx ¶
type Tx interface {
// Commit commits the transaction to storage.
// Can return an error to indicate tx failure.
Commit(ctx context.Context) error
// Discard cancels the transaction.
// If called after Commit, does nothing.
// Cannot return an error.
// Can be called unlimited times.
// Always call Discard or Commit when done with a tx.
Discard()
}
Tx is a generic transaction interface.
Click to show internal directories.
Click to hide internal directories.