workflow

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 10 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,

	"(go.temporal.io/sdk/internal.SearchAttributes).Size": false,

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

	"go.temporal.io/sdk/internal.DeterministicKeysFunc": 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
	SingleLine          bool
}

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 -config flag for setting configuration, 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.
	IdentRefs 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
	// If set, the determinism checker will include facts per object
	EnableObjectFacts bool
	// If set, the output uses "->" instead of "\n" as the hierarchy separator.
	SingleLine bool
}

Config is config for NewChecker.

Jump to

Keyboard shortcuts

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