graph

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package graph implements Kahn's topological sort over a unified dependency graph that spans services, docker containers, compose services, and cluster resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Name string
	Kind ResourceKind
}

Node is a vertex in the dependency graph.

type Resolver

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

Resolver builds and resolves a unified dependency graph.

func New

func New(cfg *config.Config) (*Resolver, error)

New builds a Resolver from a parsed config. Returns an error if any depends_on reference names a resource that doesn't exist.

func (*Resolver) Node

func (r *Resolver) Node(name string) (Node, bool)

Node returns the Node for a given resource name.

func (*Resolver) StartOrder

func (r *Resolver) StartOrder() ([]Node, error)

StartOrder returns nodes in topological order (dependencies first). Returns an error if the graph contains a cycle.

type ResourceKind

type ResourceKind int

ResourceKind identifies what kind of resource a node represents.

const (
	KindService ResourceKind = iota
	KindDocker
	KindCompose
	KindClusterImage
	KindClusterDeploy
)

func (ResourceKind) String

func (k ResourceKind) String() string

Jump to

Keyboard shortcuts

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