Documentation ¶
Index ¶
- Constants
- type Emitter
- type EmitterFunc
- type Manager
- func (m *Manager) Add(tx transaction.Transaction) (err error)
- func (m *Manager) AddEmitter(emitter Emitter)
- func (m *Manager) AddEmitterFunc(emitter func(result transaction.Result))
- func (m *Manager) AddFromConfig(config transaction.Config) (err error)
- func (m *Manager) Close() (err error)
- func (m *Manager) GetResult(name string) (result transaction.Result, err error)
- func (m *Manager) GetResults() (results []transaction.Result)
- func (m *Manager) GetTransaction(name string) (tx transaction.Transaction, err error)
- func (m *Manager) GetTransactionConfig(name string) (config transaction.Config, err error)
- func (m *Manager) GetTransactionsConfig() (configs []transaction.Config)
- func (m *Manager) New(config transaction.Config) (tx transaction.Transaction, err error)
- func (m *Manager) RemoveTransaction(name string) (err error)
- func (m *Manager) Run(ctx context.Context, name string) (result transaction.Result, err error)
Constants ¶
const (
// DefaultTransactionTimeout if not specified
DefaultTransactionTimeout = "5m"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Emitter ¶
type Emitter interface {
Emit(result transaction.Result)
}
Emitter is the interface for result emitters to external systems
type EmitterFunc ¶
type EmitterFunc func(result transaction.Result)
EmitterFunc is a function type that implements Emitter
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a manager for replicant transactions. It tracks execution, scheduling and result data.
func (*Manager) Add ¶
func (m *Manager) Add(tx transaction.Transaction) (err error)
Add adds a replicant transaction to the manager and scheduler if the scheduling spec is provided
func (*Manager) AddEmitter ¶
AddEmitter adds the given Emitter to emit result data to external systems
func (*Manager) AddEmitterFunc ¶
func (m *Manager) AddEmitterFunc(emitter func(result transaction.Result))
AddEmitterFunc is like SetEmitter, but it takes a EmitterFunc as input
func (*Manager) AddFromConfig ¶
func (m *Manager) AddFromConfig(config transaction.Config) (err error)
AddFromConfig is like Add but creates the transaction from a transaction.Config
func (*Manager) GetResult ¶
func (m *Manager) GetResult(name string) (result transaction.Result, err error)
GetResult fetches the latest result from a managed transaction
func (*Manager) GetResults ¶
func (m *Manager) GetResults() (results []transaction.Result)
GetResults fetches all latest results
func (*Manager) GetTransaction ¶
func (m *Manager) GetTransaction(name string) (tx transaction.Transaction, err error)
GetTransaction fetches a existing transaction from the manager
func (*Manager) GetTransactionConfig ¶
func (m *Manager) GetTransactionConfig(name string) (config transaction.Config, err error)
GetTransactionConfig fetches the config from a managed transaction
func (*Manager) GetTransactionsConfig ¶
func (m *Manager) GetTransactionsConfig() (configs []transaction.Config)
GetTransactionsConfig fetches all transactions definitions from the manager
func (*Manager) New ¶
func (m *Manager) New(config transaction.Config) (tx transaction.Transaction, err error)
New creates a transaction for the given config
func (*Manager) RemoveTransaction ¶
RemoveTransaction from the manager