Documentation
¶
Index ¶
- Constants
- func EnsureSchema(db *sql.DB, svcName string)
- func GetTimeoutsTableName(svcName string) string
- func NewSagaStore(svcName string, txProvider gbus.TxProvider) saga.Store
- func NewTxProvider(connStr string) (*tx.Provider, error)
- type SagaStore
- type TimeoutManager
- func (tm *TimeoutManager) ClearTimeout(tx *sql.Tx, sagaID string) error
- func (tm *TimeoutManager) RegisterTimeout(tx *sql.Tx, sagaID string, duration time.Duration) error
- func (tm *TimeoutManager) SetTimeoutFunction(timeoutFunc func(tx *sql.Tx, sagaID string) error)
- func (tm *TimeoutManager) Start() error
- func (tm *TimeoutManager) Stop() error
- type TxOutbox
Constants ¶
const ( Pending int = iota + 1 Sent )
Variables ¶
This section is empty.
Functions ¶
func EnsureSchema ¶ added in v1.1.0
EnsureSchema implements Grabbit's migrations strategy
func GetTimeoutsTableName ¶ added in v1.1.0
GetTimeoutsTableName returns the table name in which to store timeouts
func NewSagaStore ¶
func NewSagaStore(svcName string, txProvider gbus.TxProvider) saga.Store
NewSagaStore creates a bew SagaStore
Types ¶
type TimeoutManager ¶ added in v1.1.0
type TimeoutManager struct { Bus gbus.Bus Log func() logrus.FieldLogger TimeoutSaga func(*sql.Tx, string) error Txp gbus.TxProvider SvcName string // contains filtered or unexported fields }
TimeoutManager is a mysql implementation of a persistent timeoutmanager
func NewTimeoutManager ¶ added in v1.1.0
func NewTimeoutManager(bus gbus.Bus, txp gbus.TxProvider, logger func() logrus.FieldLogger, svcName string, purge bool) *TimeoutManager
NewTimeoutManager creates a new instance of a mysql based TimeoutManager
func (*TimeoutManager) ClearTimeout ¶ added in v1.1.0
func (tm *TimeoutManager) ClearTimeout(tx *sql.Tx, sagaID string) error
ClearTimeout clears a timeout for a specific saga
func (*TimeoutManager) RegisterTimeout ¶ added in v1.1.0
RegisterTimeout requests a timeout from the timeout manager
func (*TimeoutManager) SetTimeoutFunction ¶ added in v1.1.0
func (tm *TimeoutManager) SetTimeoutFunction(timeoutFunc func(tx *sql.Tx, sagaID string) error)
SetTimeoutFunction accepts the timeouting function
func (*TimeoutManager) Start ¶ added in v1.1.0
func (tm *TimeoutManager) Start() error
Start starts the timeout manager
func (*TimeoutManager) Stop ¶ added in v1.1.0
func (tm *TimeoutManager) Stop() error
Stop shuts down the timeout manager
type TxOutbox ¶
TxOutbox is a mysql based transactional outbox
func NewOutbox ¶
func NewOutbox(svcName string, txProv gbus.TxProvider, purgeOnStartup bool, cfg gbus.OutboxConfiguration) *TxOutbox
NewOutbox creates a new mysql transactional outbox
func (*TxOutbox) Save ¶
func (outbox *TxOutbox) Save(tx *sql.Tx, exchange, routingKey string, amqpMessage amqp.Publishing) error
Save stores a message in a DB to ensure delivery