graph

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package graph owns normalized pipeline DAG semantics.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilPipeline = xerror.InvalidRequired(xerror.Pipeline)
	ErrOrphanStep  = xerror.OrphanStep()
)

Functions

func ValidateConnectivity

func ValidateConnectivity(g *Graph) error

ValidateConnectivity rejects orphan query steps in the normalized graph.

Types

type Edge

type Edge struct {
	Kind         EdgeKind
	FromStepSlug slug.Slug
	ToStepSlug   slug.Slug
	FromIndex    int
	ToIndex      int
	InputName    string
}

Edge is a normalized directional data-flow edge between two steps.

func (Edge) Slug

func (e Edge) Slug() string

Slug returns the stable edge identifier used by diagnostics.

type EdgeKind

type EdgeKind string

EdgeKind identifies the spec construct that creates a data-flow edge.

const (
	EdgeKindStepInput      EdgeKind = "step_input"
	EdgeKindQueryParameter EdgeKind = "query_parameter"
)

type Graph

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

Graph is the normalized pipeline DAG.

func Normalize

func Normalize(pipeline *pipelinespec.Pipeline) (*Graph, error)

Normalize builds a normalized DAG from the pipeline spec.

func (*Graph) Edges

func (g *Graph) Edges() []Edge

Edges returns all normalized data-flow edges.

func (*Graph) Nodes

func (g *Graph) Nodes() []Node

Nodes returns steps in spec order.

func (*Graph) QueryParameterEdges

func (g *Graph) QueryParameterEdges() []Edge

QueryParameterEdges returns query parameter reference edges only.

func (*Graph) SinkInputStepSlug

func (g *Graph) SinkInputStepSlug(stepSlug slug.Slug) (slug.Slug, bool)

SinkInputStepSlug returns the upstream step slug for a sink input.

func (*Graph) Step

func (g *Graph) Step(stepSlug slug.Slug) (pipelinespec.Step, bool)

Step returns a step by slug.

func (*Graph) StepInputEdges

func (g *Graph) StepInputEdges() []Edge

StepInputEdges returns transform and sink input edges only.

func (*Graph) TopologicalSteps

func (g *Graph) TopologicalSteps() []pipelinespec.Step

TopologicalSteps returns the normalized execution order.

func (*Graph) TransformInputStepSlugs

func (g *Graph) TransformInputStepSlugs(stepSlug slug.Slug) (map[string]slug.Slug, bool)

TransformInputStepSlugs returns the upstream step slug for each named transform input.

type Node

type Node struct {
	Step  pipelinespec.Step
	Index int
}

Node is one pipeline step in the normalized graph.

Jump to

Keyboard shortcuts

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