workflow

package
v0.0.0-...-1956c26 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultIdentRefs = determinism.DefaultIdentRefs.Clone().SetAll(determinism.IdentRefs{

	"go.temporal.io/sdk/internal.propagateCancel": false,

	"(*go.temporal.io/sdk/internal.cancelCtx).cancel": false,
})

DefaultIdentRefs are additional overrides of determinism.DefaultIdentRefs for safe Temporal library functions.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	DebugfFunc          func(string, ...interface{})
	Debug               bool
	IncludePosOnMessage bool
	Determinism         *determinism.Checker
}

Checker checks if functions passed RegisterWorkflow are non-deterministic based on the results from the checker of the adjacent determinism package.

func NewChecker

func NewChecker(config Config) *Checker

NewChecker creates a Checker for the given config.

func (*Checker) NewAnalyzer

func (c *Checker) NewAnalyzer() *analysis.Analyzer

NewAnalyzer creates a Go analysis analyzer that can be used in existing tools. There is a -set-decl flag for adding ident refs overrides, a -workflow-debug flag for enabling debug logs, a -determinism-debug flag for enabling determinism debug logs, and a -show-pos flag for showing position on nested errors. This analyzer does not have any results but does set the same facts as the determinism analyzer (*determinism.NonDeterminisms).

func (*Checker) Run

func (c *Checker) Run(pass *analysis.Pass) error

Run executes this checker for the given pass.

type Config

type Config struct {
	// If empty, uses DefaultIdentRefs.
	DefaultIdentRefs determinism.IdentRefs
	// If nil, uses log.Printf.
	DebugfFunc func(string, ...interface{})
	// Must be set to true to see advanced debug logs.
	Debug bool
	// Must be set to true to see advanced determinism debug logs.
	DeterminismDebug bool
	// If set, the file and line/col position is present on nested errors.
	IncludePosOnMessage bool
}

Config is config for NewChecker.

Jump to

Keyboard shortcuts

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