graph

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 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) DependenciesOf added in v0.16.0

func (dg *DependencyGraph) DependenciesOf(res *resource.State) ResourceSet

DependenciesOf returns a ResourceSet of resources upon which the given resource depends. The resource's parent is included in the returned set.

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.

type ResourceSet added in v0.16.0

type ResourceSet map[*resource.State]bool

ResourceSet represents a set of Resources.

func (ResourceSet) Intersect added in v0.16.0

func (s ResourceSet) Intersect(other ResourceSet) ResourceSet

Intersect returns a new set that is the intersection of the two given resource sets.

Jump to

Keyboard shortcuts

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