tx

package
v0.0.0-...-a50e536 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	Database *sql.DB
}

Provider for PostgreSQL or MySQ

func (*Provider) Dispose

func (provider *Provider) Dispose()

Dispose database connections

func (*Provider) New

func (provider *Provider) New() (*sql.Tx, error)

New transaction

func (*Provider) Ping

func (provider *Provider) Ping(timeoutInSeconds time.Duration) bool

Ping checks if the provider is available and timeouts according to the given duration

type SagaStore

type SagaStore struct {
	Tx            gbus.TxProvider
	SvcName       string
	ParamsMarkers []string
}

SagaStore base type for embedding for new transactional saga stores

func (*SagaStore) DeleteSaga

func (store *SagaStore) DeleteSaga(tx *sql.Tx, instance *saga.Instance) error

DeleteSaga implements interface method store.DeleteSaga

func (*SagaStore) GetSagaByID

func (store *SagaStore) GetSagaByID(tx *sql.Tx, sagaID string) (*saga.Instance, error)

GetSagaByID implements interface method store.GetSagaByID

func (*SagaStore) GetSagasByType

func (store *SagaStore) GetSagasByType(tx *sql.Tx, sagaType reflect.Type) (instances []*saga.Instance, err error)

GetSagasByType implements interface method store.GetSagasByType

func (*SagaStore) GetSagatableName

func (store *SagaStore) GetSagatableName() string

GetSagatableName returns the table name in which to store the Sagas

func (*SagaStore) NewTx

func (store *SagaStore) NewTx() *sql.Tx

NewTx creates a new transaction from the underlying TxProvider

func (*SagaStore) Purge

func (store *SagaStore) Purge() error

Purge cleans up the saga store, to be used in tests and in extreme situations in production

func (*SagaStore) RegisterSagaType

func (store *SagaStore) RegisterSagaType(saga gbus.Saga)

RegisterSagaType implements interface method store.RegisterSagaType

func (*SagaStore) SaveNewSaga

func (store *SagaStore) SaveNewSaga(tx *sql.Tx, sagaType reflect.Type, newInstance *saga.Instance) (err error)

SaveNewSaga implements interface method store.SaveNewSaga

func (*SagaStore) UpdateSaga

func (store *SagaStore) UpdateSaga(tx *sql.Tx, instance *saga.Instance) (err error)

UpdateSaga implements interface method store.UpdateSaga

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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