depgraph

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package depgraph provides functionality to resolve dependencies. The depth-first topological sorting algorithm is used. See https://en.wikipedia.org/wiki/Topological_sorting#Depth-first_search

Index

Constants

This section is empty.

Variables

View Source
var ErrCyclicGraph = errors.New("the dependency graph is cyclic")

ErrCyclicGraph is an error indicating that the dependency graph is cyclic and therefore can't be resolved.

Functions

This section is empty.

Types

type DepGraph

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

DepGraph resolves dependency graph.

func (*DepGraph) Add

func (dg *DepGraph) Add(id string, dependsOn []string)

Add a dependency to the dependency graph.

func (*DepGraph) Resolve

func (dg *DepGraph) Resolve() ([]string, error)

Resolve dependencies added via Add method.

Jump to

Keyboard shortcuts

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