Documentation ¶
Overview ¶
Package manager implements a transaction manager for running and maintaining test transactions.
Index ¶
- Constants
- type Emitter
- type EmitterFunc
- type Manager
- func (m *Manager) Add(config transaction.Config) (err error)
- func (m *Manager) AddEmitter(emitter Emitter)
- func (m *Manager) AddEmitterFunc(emitter func(result transaction.Result))
- func (m *Manager) Close() (err error)
- func (m *Manager) Delete(name string) (err error)
- func (m *Manager) Get(name string) (config transaction.Config, err error)
- func (m *Manager) GetAll() (configs []transaction.Config)
- func (m *Manager) GetResult(name string) (result transaction.Result, err error)
- func (m *Manager) GetResults() (results []transaction.Result)
- func (m *Manager) Run(c transaction.Config) (r transaction.Result)
- func (m *Manager) RunByName(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(config transaction.Config) (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) Get ¶ added in v0.2.0
func (m *Manager) Get(name string) (config transaction.Config, err error)
Get a existing transaction from the manager by name
func (*Manager) GetAll ¶ added in v0.2.0
func (m *Manager) GetAll() (configs []transaction.Config)
GetAll transactions from the manager
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) Run ¶
func (m *Manager) Run(c transaction.Config) (r transaction.Result)
Run the given transaction