refactor

package
v0.0.0-...-c64a997 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeResource TypeName = "resource"
	TypeOutput            = "output"
	TypeVar               = "var"
	TypeLocal             = "local"
	TypeData              = "data"
	TypeModule            = "module"
)

Variables

This section is empty.

Functions

func ParseHclBytes

func ParseHclBytes(src []byte, filename string) (*hclwrite.File, error)

Source parses HCL and returns *hclwrite.File filename is a metadata of input stream and used only for an error message.

func ParseHclFile

func ParseHclFile(filename string) (*hclwrite.File, error)

func RenameInFile

func RenameInFile(filename string, file *hclwrite.File, fromAddress, toAddress *Address) error

func RenameLocalInFile

func RenameLocalInFile(filename string, file *hclwrite.File, fromAddress, toAddress *Address) error

func RenameVariablePrefixInBody

func RenameVariablePrefixInBody(blockType string, body *hclwrite.Body, fromAddress, toAddress *Address)

Types

type Address

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

func ParseAddress

func ParseAddress(addr string) *Address

func (*Address) BlockType

func (a *Address) BlockType() string

func (*Address) RefName

func (a *Address) RefName() string

func (*Address) RefNameArray

func (a *Address) RefNameArray() []string

type FileUpdate

type FileUpdate struct {
	Filename   string
	BeforeText string
	AfterText  string
}

type TypeName

type TypeName string

type UpdatePlan

type UpdatePlan struct {
	FileUpdates []*FileUpdate
}

func Mv

func Mv(fromAddressString, toFile, configPath string) (*UpdatePlan, error)

func Rename

func Rename(fromAddressString, toAddressString, configPath string) (*UpdatePlan, error)

Jump to

Keyboard shortcuts

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