graph

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DependencyGraph

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

DependencyGraph represents a dependency graph encoded within a resource snapshot.

func NewDependencyGraph

func NewDependencyGraph(resources []*resource.State) *DependencyGraph

NewDependencyGraph creates a new DependencyGraph from a list of resources. The resources should be in topological order with respect to their dependencies.

func (*DependencyGraph) DependingOn

func (dg *DependencyGraph) DependingOn(res *resource.State) []*resource.State

DependingOn returns a slice containing all resources that directly or indirectly depend upon the given resource. The returned slice is guaranteed to be in topological order with respect to the snapshot dependency graph.

The time complexity of DependingOn is linear with respect to the number of resources.

Jump to

Keyboard shortcuts

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