dependency

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package dependency provides service dependency graph management for Docker Compose projects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceDependencyGraph

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

ServiceDependencyGraph represents the dependency relationships between services using a directed graph.

func BuildServiceDependencyGraph

func BuildServiceDependencyGraph(project *types.Project) (*ServiceDependencyGraph, error)

BuildServiceDependencyGraph builds a dependency graph for all services in a project.

func NewServiceDependencyGraph

func NewServiceDependencyGraph() *ServiceDependencyGraph

NewServiceDependencyGraph creates a new service dependency graph.

func (*ServiceDependencyGraph) AddDependency

func (sdg *ServiceDependencyGraph) AddDependency(dependent, dependency string) error

AddDependency adds a dependency relationship where dependent depends on dependency.

func (*ServiceDependencyGraph) AddService

func (sdg *ServiceDependencyGraph) AddService(serviceName string) error

AddService adds a service to the dependency graph.

func (*ServiceDependencyGraph) GetDependencies

func (sdg *ServiceDependencyGraph) GetDependencies(serviceName string) ([]string, error)

GetDependencies returns the services that the given service depends on.

func (*ServiceDependencyGraph) GetDependents

func (sdg *ServiceDependencyGraph) GetDependents(serviceName string) ([]string, error)

GetDependents returns the services that depend on the given service.

func (*ServiceDependencyGraph) GetTopologicalOrder

func (sdg *ServiceDependencyGraph) GetTopologicalOrder() ([]string, error)

GetTopologicalOrder returns services in topological order (dependencies first).

func (*ServiceDependencyGraph) HasCycles

func (sdg *ServiceDependencyGraph) HasCycles() bool

HasCycles checks if the dependency graph contains cycles.

Jump to

Keyboard shortcuts

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