executor

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAG

type DAG struct {
	// contains filtered or unexported fields
}

DAG represents a directed acyclic graph of resources

func NewDAG

func NewDAG(instances []config.ResourceInstance) (*DAG, error)

NewDAG creates a new DAG from resource instances

func (*DAG) GetAllNodes

func (d *DAG) GetAllNodes() map[string]*DAGNode

GetAllNodes returns all nodes in the DAG

func (*DAG) GetExecutionOrder

func (d *DAG) GetExecutionOrder() [][]string

GetExecutionOrder returns the topological order for execution

func (*DAG) GetFailedNodes

func (d *DAG) GetFailedNodes() []*DAGNode

GetFailedNodes returns all nodes that have failed

func (*DAG) GetNode

func (d *DAG) GetNode(nodeID string) (*DAGNode, bool)

GetNode returns a node by ID

func (*DAG) GetReadyNodes

func (d *DAG) GetReadyNodes() []*DAGNode

GetReadyNodes returns nodes that are ready to execute

func (*DAG) HasFailures

func (d *DAG) HasFailures() bool

HasFailures returns true if any node has failed

func (*DAG) IsComplete

func (d *DAG) IsComplete() bool

IsComplete returns true if all nodes have completed (successfully or with error)

func (*DAG) SetNodeStatus

func (d *DAG) SetNodeStatus(nodeID string, status NodeStatus, err error)

SetNodeStatus updates the status of a node

type DAGNode

type DAGNode struct {
	ID           string
	Instance     config.ResourceInstance
	Dependencies []string
	Dependents   []string
	Status       NodeStatus
	Error        error
}

DAGNode represents a node in the dependency graph

type NodeStatus

type NodeStatus string

NodeStatus represents the execution status of a node

const (
	StatusPending   NodeStatus = "pending"
	StatusReady     NodeStatus = "ready"
	StatusRunning   NodeStatus = "running"
	StatusCompleted NodeStatus = "completed"
	StatusFailed    NodeStatus = "failed"
)

Jump to

Keyboard shortcuts

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