compare

package
v0.0.0-...-bda4b31 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SourceKeys = []string{sourceTerraform, sourceConfig}
)

Functions

This section is empty.

Types

type LocatedItem

type LocatedItem struct {
	*load.ConfigurationItem
	// contains filtered or unexported fields
}

LocatedItem is a configuration item that has been located in a source. That source could be a snapshot, a terraform state, or both. It also includes a parent, if any.

func Reconcile

func Reconcile(snapshot load.Snapshot, tfstates map[string]load.TerraformState) (items []*LocatedItem, err error)

Reconcile reconcile the snapshot and tfstates.

func (LocatedItem) Ephemeral

func (l LocatedItem) Ephemeral() bool

func (LocatedItem) Owned

func (l LocatedItem) Owned() bool

func (LocatedItem) Source

func (l LocatedItem) Source(src string) bool

type ResourceTypeCount

type ResourceTypeCount struct {
	ResourceType string
	Unmapped     int
	Mapped       int
}

ResourceTypeCount used to keep track of resources that are only in one source or the other. Tracks separate counts for mapped and unmapped.

type SourceSummary

type SourceSummary struct {
	Name              string
	Total             int
	Only              []ResourceTypeCount
	OnlyCount         int
	OnlyMappedCount   int
	OnlyUnmappedCount int
}

type Summary

type Summary struct {
	// ByType map by each type, with the values showing how many there
	// are in each source, total, and both
	ByType          []TypeSummary
	Sources         []SourceSummary
	BothResources   int
	SingleResources int
}

Summary struct holding summary information about the various resources. This is expected to evolve over time.

func Summarize

func Summarize(items []*LocatedItem) (results *Summary, err error)

Summarize summarize the information from the reconciliation.

type TypeSummary

type TypeSummary struct {
	ResourceType string
	Count        int
	Source       map[string]int
	SingleOnly   int
	Both         int
}

Jump to

Keyboard shortcuts

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