data

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortMapByValueAndKey

func SortMapByValueAndKey(m map[string]int) map[string]int

Types

type Check

type Check struct {
	ID                string
	Name              string
	Status            string
	RelatedGuidelines string
	Errors            []Error
}

type Codebase

type Codebase struct {
	Layers   []*Layer
	Stats    CodebaseStats
	Warnings Warnings
}

func (*Codebase) BuildLayers

func (c *Codebase) BuildLayers()

func (*Codebase) ComputeStats

func (c *Codebase) ComputeStats()

type CodebaseStats

type CodebaseStats struct {
	BiggestLayer            *Layer
	BiggestChildModule      *Module
	DistinctResourceTypes   map[string]int
	DistinctDatasourceTypes map[string]int
	Depth                   int
	Size                    Size
}

type Error added in v0.2.0

type Error struct {
	Path        string
	LineNumber  int
	Description string
}

type Layer

type Layer struct {
	Name       string
	FullPath   string
	Plan       *tfjson.Plan
	State      *tfjson.State
	RootModule *Module
	Warnings   Warnings
}

func (*Layer) BuildRootModule

func (layer *Layer) BuildRootModule()

func (*Layer) ComputePlan

func (l *Layer) ComputePlan()

func (*Layer) ComputeState

func (l *Layer) ComputeState()

func (*Layer) ComputeWarnings

func (layer *Layer) ComputeWarnings()

type Module

type Module struct {
	Address string
	Name    string
	// Resources and datasources
	ObjectTypes []*ObjectType
	Children    []*Module
	Stats       ModuleStats
}

func (*Module) ComputeStats

func (m *Module) ComputeStats()

type ModuleStats

type ModuleStats struct {
	DistinctResourceTypes   map[string]int
	DistinctDatasourceTypes map[string]int
	Depth                   int
	Size                    Size
	CumulatedSize           Size
}

type Object

type Object struct {
	Name  string
	Count int
}

type ObjectType

type ObjectType struct {
	Type      string
	Kind      string // resource or datasource
	Index     any    // Can be a string or an int
	Instances []Object
	Count     int
}

type Size

type Size struct {
	Resources   int
	Datasources int
	Modules     int
}

type TerraformCodeBlock added in v0.2.0

type TerraformCodeBlock struct {
	Name              string
	ModulePath        string
	Pos               int
	FilePath          string
	WhitelistComments []WhitelistComment
}

type TerraformModule

type TerraformModule struct {
	Name         string
	FullPath     string
	ModuleConfig tfconfig.Module
	Resources    map[string]TerraformCodeBlock
}

type Warnings

type Warnings struct {
	DatasourceInModuleWarning []datasourceInModuleWarning
	ModuleDepthWarning        []moduleDepthWarning
}

type WhitelistComment added in v0.2.0

type WhitelistComment struct {
	CheckID    string
	LineNumber int
	Path       string
}

Jump to

Keyboard shortcuts

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