manager

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package manager implements a transaction manager for running and maintaining test transactions.

Index

Constants

View Source
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

func (EmitterFunc) Emit

func (e EmitterFunc) Emit(result transaction.Result)

Emit results

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 New

func New(s store.Store, executorURL string) (manager *Manager)

New creates a new manager

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

func (m *Manager) AddEmitter(emitter Emitter)

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) Close

func (m *Manager) Close() (err error)

Close the manager

func (*Manager) Delete added in v0.2.0

func (m *Manager) Delete(name string) (err error)

Delete a transaction from the manager by name

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

Run the given transaction

func (*Manager) RunByName added in v0.2.0

func (m *Manager) RunByName(name string) (result transaction.Result, err error)

RunByName a managed transaction in a ad-hoc manner.

Jump to

Keyboard shortcuts

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