Help us shape the future of Go! Take the 2026 Go Developer Survey

workflow

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package workflow provides the base workflow implementation.

BaseWorkflow wraps an orchestration function and implements the Workflow[In, Out] interface from core. It serves as the innermost layer in a decorator chain — decorators (logging, metrics) wrap BaseWorkflow to add cross-cutting concerns without modifying the orchestration logic.

Unlike pipelines (pure stateless transformations), workflows coordinate stateful operations across services, pipelines, repositories, and caches.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseWorkflow

type BaseWorkflow[In any, Out any] struct {
	// contains filtered or unexported fields
}

BaseWorkflow wraps an orchestration function and implements the Workflow[In, Out] interface. It provides a functional escape hatch for simple workflows, though workflows are typically stateful (holding service/pipeline/cache references).

func NewBaseWorkflow

func NewBaseWorkflow[In, Out any](
	fn func(context.Context, In) (Out, error),
) *BaseWorkflow[In, Out]

NewBaseWorkflow creates a new BaseWorkflow wrapping the given function. Panics if fn is nil.

func (*BaseWorkflow[In, Out]) Execute

func (w *BaseWorkflow[In, Out]) Execute(ctx context.Context, input In) (Out, error)

Execute runs the wrapped orchestration function. Context is passed through for cancellation and tracing support.

Directories

Path Synopsis
Package decorators provides fluent decorator composition for workflows.
Package decorators provides fluent decorator composition for workflows.

Jump to

Keyboard shortcuts

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