parser

package
v0.58.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallModule

type CallModule struct {
	Source string              `json:"source"`
	Module ConfigurationModule `json:"module"`
}

type Change

type Change struct {
	Before map[string]any `json:"before"`
	After  map[string]any `json:"after"`
}

type ChildModule

type ChildModule struct {
	Module
	Address string `json:"address"`
}

type Configuration

type Configuration struct {
	RootModule ConfigurationModule `json:"root_module"`
}

type ConfigurationChildModule

type ConfigurationChildModule struct {
	ConfigurationModule
	Address string `json:"address"`
}

type ConfigurationModule

type ConfigurationModule struct {
	Resources   []ConfigurationResource `json:"resources"`
	ModuleCalls map[string]CallModule   `json:"module_calls"`
}

type ConfigurationResource

type ConfigurationResource struct {
	Resource
	Expressions map[string]any `json:"expressions"`
}

type Module

type Module struct {
	Resources    []Resource    `json:"resources"`
	ChildModules []ChildModule `json:"child_modules"`
}

type Parser

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

func New

func New() *Parser

func (*Parser) Parse

func (p *Parser) Parse(reader io.Reader) (*PlanFile, error)

func (*Parser) ParseFile

func (p *Parser) ParseFile(filepath string) (*PlanFile, error)

type PlanFile

type PlanFile struct {
	FormatVersion    string           `json:"format_version"`
	TerraformVersion string           `json:"terraform_version"`
	PlannedValues    PlannedValues    `json:"planned_values"`
	ResourceChanges  []ResourceChange `json:"resource_changes"`
	Configuration    Configuration    `json:"configuration"`
}

func (*PlanFile) ToFS

func (p *PlanFile) ToFS() (*memoryfs.FS, error)

type PlannedValues

type PlannedValues struct {
	RootModule Module `json:"root_module"`
}

type Resource

type Resource struct {
	Address       string `json:"address"`
	ModuleAddress string `json:"module_address"`
	Mode          string `json:"mode"`
	Type          string `json:"type"`
	Name          string `json:"name"`
	ProviderName  string `json:"provider_name"`
	SchemaVersion int    `json:"schema_version"`
}

type ResourceChange

type ResourceChange struct {
	Resource
	Change `json:"change"`
}

Jump to

Keyboard shortcuts

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