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 ¶
- func CheckDependencies(repo ActionRepository, action *semantic.SemanticScheduledAction) (bool, error)
- func GetExecutionOrder(actions []*semantic.SemanticScheduledAction) ([]*semantic.SemanticScheduledAction, error)
- func ValidateDAG(repo ActionRepository, action *semantic.SemanticScheduledAction) error
- type ActionRepository
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