graph

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package graph validates the static task graph: it rejects dependency and task call cycles and over-deep call chains before any action runs. It works on plain node names and edge lists, so it has no knowledge of the task model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(nodes []string, edges map[string][]string, maxDepth int) error

Check validates every node in nodes using edges. An edge that names an unknown node is ignored: reference validation is the caller's concern. maxDepth <= 0 skips the depth check.

Types

type CycleError

type CycleError struct {
	// Path lists the cycle starting and ending with the same node.
	Path []string
}

CycleError reports a dependency or task call cycle with its full path.

func (*CycleError) Error

func (e *CycleError) Error() string

type DepthError

type DepthError struct {
	// Max is the configured maximum depth.
	Max int
	// Path is the longest chain that exceeded it.
	Path []string
}

DepthError reports a call chain longer than the configured maximum.

func (*DepthError) Error

func (e *DepthError) Error() string

Jump to

Keyboard shortcuts

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