common

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParentInit                   = "ParentInit"
	ParentSpawnChildren          = "ParentSpawnChildren"
	ParentWaitForChildren        = "ParentWaitForChildren"
	ParentProcessChildrenResults = "ParentProcessChildrenResults"
	ParentFinish                 = "ParentFinish"
)

State constants for parent workflow

View Source
const (
	ChildInit       = "ChildInit"
	ChildProcessing = "ChildProcessing"
	ChildWakeParent = "ChildWakeParent"
	ChildFinish     = "ChildFinish"
)

State constants for child workflow

View Source
const VAR_IP = "ip"

Variables

View Source
var StateApprove string = "Approve"
View Source
var StateApproveError string = "ApproveError"
View Source
var StateFinish string = "Finish"
View Source
var StateGetIpData string = "StateGetIpData"

Define a named string type

View Source
var StateInit string = "Init"
View Source
var StateReview string = "Review"

Functions

func GetWfAndExpectState

func GetWfAndExpectState(t *testing.T, port int, url string, wf models.CreateWorkflowResponse, req *http.Request, err error, client *http.Client, state string)

Types

type ChildWorkflow added in v1.5.0

type ChildWorkflow struct {
	core.BaseWorkflow
	// contains filtered or unexported fields
}

ChildWorkflow represents a child workflow

func NewChildWorkflow added in v1.5.0

func NewChildWorkflow(repo *TestRepository) *ChildWorkflow

NewChildWorkflow creates a new instance of ChildWorkflow

func (*ChildWorkflow) ChildInit added in v1.5.0

func (w *ChildWorkflow) ChildInit(ctx context.Context) (*models.NextState, error)

ChildInit initializes the child workflow

func (*ChildWorkflow) ChildProcessing added in v1.5.0

func (w *ChildWorkflow) ChildProcessing(ctx context.Context) (*models.NextState, error)

ChildProcessing performs the child workflow's task

func (*ChildWorkflow) ChildWakeParent added in v1.5.0

func (w *ChildWorkflow) ChildWakeParent(ctx context.Context) (*models.NextState, error)

ChildWakeParent wakes the parent workflow

func (*ChildWorkflow) Description added in v1.5.0

func (w *ChildWorkflow) Description() string

func (*ChildWorkflow) GetAllStates added in v1.5.0

func (w *ChildWorkflow) GetAllStates() []models.WorkflowState

func (*ChildWorkflow) GetRetryConfig added in v1.5.0

func (w *ChildWorkflow) GetRetryConfig() models.RetryConfig

func (*ChildWorkflow) GetStateVariables added in v1.5.0

func (w *ChildWorkflow) GetStateVariables() map[string]string

func (*ChildWorkflow) GetWorkflowData added in v1.5.0

func (w *ChildWorkflow) GetWorkflowData() *domain.Workflow

func (*ChildWorkflow) InitialState added in v1.5.0

func (w *ChildWorkflow) InitialState() string

func (*ChildWorkflow) Setup added in v1.5.0

func (w *ChildWorkflow) Setup(wf *domain.Workflow)

Setup initializes the workflow with domain data

func (*ChildWorkflow) StateTransitions added in v1.5.0

func (w *ChildWorkflow) StateTransitions() map[string][]string

func (*ChildWorkflow) WakeParent added in v1.5.0

func (w *ChildWorkflow) WakeParent(ctx context.Context) error

WakeParent implements the ParentChildCapable interface

type ParentWorkflow added in v1.5.0

type ParentWorkflow struct {
	core.BaseWorkflow
	// contains filtered or unexported fields
}

ParentWorkflow represents a workflow that spawns child workflows

func NewParentWorkflow added in v1.5.0

func NewParentWorkflow(repo *TestRepository) *ParentWorkflow

NewParentWorkflow creates a new instance of ParentWorkflow

func (*ParentWorkflow) Description added in v1.5.0

func (w *ParentWorkflow) Description() string

func (*ParentWorkflow) GetAllStates added in v1.5.0

func (w *ParentWorkflow) GetAllStates() []models.WorkflowState

func (*ParentWorkflow) GetChildWorkflows added in v1.5.0

func (w *ParentWorkflow) GetChildWorkflows(ctx context.Context) ([]domain.Workflow, error)

GetChildWorkflows implements the ParentChildCapable interface

func (*ParentWorkflow) GetRetryConfig added in v1.5.0

func (w *ParentWorkflow) GetRetryConfig() models.RetryConfig

func (*ParentWorkflow) GetStateVariables added in v1.5.0

func (w *ParentWorkflow) GetStateVariables() map[string]string

func (*ParentWorkflow) GetWorkflowData added in v1.5.0

func (w *ParentWorkflow) GetWorkflowData() *domain.Workflow

func (*ParentWorkflow) InitialState added in v1.5.0

func (w *ParentWorkflow) InitialState() string

func (*ParentWorkflow) ParentInit added in v1.5.0

func (w *ParentWorkflow) ParentInit(ctx context.Context) (*models.NextState, error)

ParentInit initializes the parent workflow

func (*ParentWorkflow) ParentProcessChildrenResults added in v1.5.0

func (w *ParentWorkflow) ParentProcessChildrenResults(ctx context.Context) (*models.NextState, error)

ParentProcessChildrenResults processes results from child workflows

func (*ParentWorkflow) ParentSpawnChildren added in v1.5.0

func (w *ParentWorkflow) ParentSpawnChildren(ctx context.Context) (*models.NextState, error)

ParentSpawnChildren spawns child workflows

func (*ParentWorkflow) ParentWaitForChildren added in v1.5.0

func (w *ParentWorkflow) ParentWaitForChildren(ctx context.Context) (*models.NextState, error)

ParentWaitForChildren waits for child workflows to complete

func (*ParentWorkflow) Setup added in v1.5.0

func (w *ParentWorkflow) Setup(wf *domain.Workflow)

Setup initializes the workflow with domain data

func (*ParentWorkflow) StateTransitions added in v1.5.0

func (w *ParentWorkflow) StateTransitions() map[string][]string

type QuickWorkflow

type QuickWorkflow struct {
	core.BaseWorkflow
}

func (*QuickWorkflow) Description

func (m *QuickWorkflow) Description() string

func (*QuickWorkflow) GetAllStates

func (m *QuickWorkflow) GetAllStates() []models.WorkflowState

func (*QuickWorkflow) GetRetryConfig

func (m *QuickWorkflow) GetRetryConfig() models.RetryConfig

func (*QuickWorkflow) GetStateVariables

func (m *QuickWorkflow) GetStateVariables() map[string]string

func (*QuickWorkflow) GetWorkflowData

func (m *QuickWorkflow) GetWorkflowData() *domain.Workflow

func (*QuickWorkflow) Init

Each method returns the next state

func (*QuickWorkflow) InitialState

func (m *QuickWorkflow) InitialState() string

func (*QuickWorkflow) Setup

func (m *QuickWorkflow) Setup(wf *domain.Workflow)

func (*QuickWorkflow) StateGetIpData

func (m *QuickWorkflow) StateGetIpData(ctx context.Context) (*models.NextState, error)

func (*QuickWorkflow) StateTransitions

func (m *QuickWorkflow) StateTransitions() map[string][]string

type RepairWorkflow added in v1.5.0

type RepairWorkflow struct {
	core.BaseWorkflow
	Clock core.Clock
}

func (*RepairWorkflow) Description added in v1.5.0

func (m *RepairWorkflow) Description() string

func (*RepairWorkflow) GetAllStates added in v1.5.0

func (m *RepairWorkflow) GetAllStates() []models.WorkflowState

func (*RepairWorkflow) GetRetryConfig added in v1.5.0

func (m *RepairWorkflow) GetRetryConfig() models.RetryConfig

func (*RepairWorkflow) GetStateVariables added in v1.5.0

func (m *RepairWorkflow) GetStateVariables() map[string]string

func (*RepairWorkflow) GetWorkflowData added in v1.5.0

func (m *RepairWorkflow) GetWorkflowData() *domain.Workflow

func (*RepairWorkflow) Init added in v1.5.0

Each method returns the next state

func (*RepairWorkflow) InitialState added in v1.5.0

func (m *RepairWorkflow) InitialState() string

func (*RepairWorkflow) Setup added in v1.5.0

func (m *RepairWorkflow) Setup(wf *domain.Workflow)

func (*RepairWorkflow) StateGetIpData added in v1.5.0

func (m *RepairWorkflow) StateGetIpData(ctx context.Context) (*models.NextState, error)

func (*RepairWorkflow) StateTransitions added in v1.5.0

func (m *RepairWorkflow) StateTransitions() map[string][]string

type TestRepository added in v1.5.0

type TestRepository struct {
	ParentWoken  bool
	ChildCreated bool
}

TestRepository is a mock repository for testing purposes

type WaitWorkflow

type WaitWorkflow struct {
	core.BaseWorkflow
}

func (*WaitWorkflow) Description

func (m *WaitWorkflow) Description() string

func (*WaitWorkflow) GetAllStates

func (m *WaitWorkflow) GetAllStates() []models.WorkflowState

func (*WaitWorkflow) GetRetryConfig

func (m *WaitWorkflow) GetRetryConfig() models.RetryConfig

func (*WaitWorkflow) GetStateVariables

func (m *WaitWorkflow) GetStateVariables() map[string]string

func (*WaitWorkflow) GetWorkflowData

func (m *WaitWorkflow) GetWorkflowData() *domain.Workflow

func (*WaitWorkflow) Init

func (m *WaitWorkflow) Init(ctx context.Context) (*models.NextState, error)

Each method returns the next state

func (*WaitWorkflow) InitialState

func (m *WaitWorkflow) InitialState() string

func (*WaitWorkflow) Setup

func (m *WaitWorkflow) Setup(wf *domain.Workflow)

func (*WaitWorkflow) StateGetIpData

func (m *WaitWorkflow) StateGetIpData(ctx context.Context) (*models.NextState, error)

func (*WaitWorkflow) StateTransitions

func (m *WaitWorkflow) StateTransitions() map[string][]string

Jump to

Keyboard shortcuts

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