report

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Report)

An Option adds information to a Report.

func Action

func Action(
	act action.Action,
	start, end time.Time,
	opts ...action.Option,
) Option

Action returns an Option that adds an action.Report to a SAGA Report.

func Add

func Add(acts ...action.Report) Option

Add returns an Option that adds action.Reports to a SAGA Report.

func Error

func Error(err error) Option

Error returns an Option that adds an error to a Report.

type Report

type Report struct {
	// Start is the Time the SAGA started.
	Start time.Time
	// End is the Time the SAGA finished.
	End time.Time
	// Runtime is the runtime of the SAGA.
	Runtime time.Duration
	// Actions are the Actions that have been run.
	Actions []action.Report
	// Succeeded are the succeeded Actions.
	Succeeded []action.Report
	// Failed are the failed Actions.
	Failed []action.Report
	// Compensated are the compensated Actions.
	Compensated []action.Report
	// Error is the error that made the SAGA fail.
	Error error
}

A Report gives information about the execution of a SAGA.

func New

func New(start, end time.Time, opts ...Option) Report

New returns a Report that is filled by opts.

func (*Report) Report

func (r *Report) Report(r2 Report)

Report overrides Report r with the contents of Report r2.

Jump to

Keyboard shortcuts

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