graph

package
v0.14.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2018 License: Apache-2.0 Imports: 2 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