repo

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2015 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemTransaction

type InMemTransaction bool

InMemTransaction satisifies the Transaction interface for in-memory systems. However, the only thing it really does is ensure that the same transaction is can't be committed/rolled back more than once. As such, this can lead to data corruption and should not be used in production systems.

func (*InMemTransaction) Commit

func (i *InMemTransaction) Commit() error

func (*InMemTransaction) Rollback

func (i *InMemTransaction) Rollback() error

type Transaction

type Transaction interface {
	// Commit will persist the changes in the transaction.
	Commit() error

	// Rollback undoes the changes in a transaction
	Rollback() error
}

Transaction is an abstraction of transactions typically found in database systems. One of Commit() or Rollback() must be called on each transaction.

func InMemTransactionFactory

func InMemTransactionFactory() (Transaction, error)

type TransactionFactory

type TransactionFactory func() (Transaction, error)

Jump to

Keyboard shortcuts

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