graph

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package graph provides directed acyclic graph (DAG) utilities for dependency management. This package offers cycle detection and topological sorting for workflow dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDependencies

func CheckDependencies(repo ActionRepository, action *semantic.SemanticScheduledAction) (bool, error)

CheckDependencies checks if all dependencies for an action have completed successfully Uses repository to retrieve dependency statuses

func GetExecutionOrder

func GetExecutionOrder(actions []*semantic.SemanticScheduledAction) ([]*semantic.SemanticScheduledAction, error)

GetExecutionOrder returns actions in topologically sorted order using Kahn's algorithm Actions with no dependencies come first, then actions depending on them, etc.

func ValidateDAG

func ValidateDAG(repo ActionRepository, action *semantic.SemanticScheduledAction) error

ValidateDAG checks for circular dependencies in action graph Uses repository's native cycle detection if available (e.g., Neo4j)

Types

type ActionRepository

type ActionRepository interface {
	GetAction(id string) (*semantic.SemanticScheduledAction, error)
	GetAllDependencies(id string) ([]string, error)
	WouldCreateCycle(actionID, dependencyID string) (bool, error)
}

ActionRepository defines the interface for retrieving actions from storage

Jump to

Keyboard shortcuts

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