Documentation ¶
Overview ¶
Package inout contains functions that deal with io operations, reading and writing the contents of the files generated by [scf]
Index ¶
- func CheckTfmoduleEntryPoints(yaml YamlMapping)
- func ReadMultipleResourceGroups(src string, newFolder string) (string, string)
- func WriteToCsv(resources []CsvResources, filename string)
- func WriteToFile(content string, path string, success string)
- func WriteYaml(filename string, resources []ModuleResource)
- type BackendConf
- type BlockInnerKey
- type CommonVar
- type CsvResources
- type Imports
- type ModuleResource
- type Modules
- type Outputs
- type ParsedTf
- type Resource
- type Template
- type UnmappedOutputs
- type YamlMapping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckTfmoduleEntryPoints ¶
func CheckTfmoduleEntryPoints(yaml YamlMapping)
func WriteToCsv ¶
func WriteToCsv(resources []CsvResources, filename string)
WriteToCsv it takes the structure []CsvResources and writes it into the csv filename provided
func WriteToFile ¶
WriteToFile It takes the content, the filename path and a success string and writes the content to the file and prints the success string
func WriteYaml ¶
func WriteYaml(filename string, resources []ModuleResource)
WriteYaml It takes an filename and the resources and transform them to module syntax to write the Yaml file
Types ¶
type BackendConf ¶
type BlockInnerKey ¶
type CsvResources ¶
type ModuleResource ¶
func ParseCSV ¶
func ParseCSV(filename string) []ModuleResource
ParseCSV read the csv file provided and parse each resource with is module into an array of structured ModuleResource
type ParsedTf ¶
func ReadTf ¶
ReadTf parses the contents provided of the raw []byte and returns a structure of ParsedTf with the providers and resources
func ReadTfFiles ¶
ParseConfig read the contents of the tf files and parses into a ParsedTf structure
type Resource ¶
type Resource struct { ResourceID string `json:"resource_id"` ResourceType string `json:"resource_type"` ResourceName string `json:"resource_name"` }
func JsonParser ¶
JsonParser read the json file provided and parse each resource into an array of structured Resource
type Template ¶
type Template struct { //Subscription_ID string //no UnmappedResources []string NotFoundResources []UnmappedOutputs FoundResources []UnmappedOutputs }
type UnmappedOutputs ¶
type YamlMapping ¶
type YamlMapping struct { Modules []Modules `yaml:"modules"` CommonVars []CommonVar `yaml:"common"` Confg []string `yaml:"config"` Backend BackendConf `yaml:"backend"` }
var Yaml_mapping YamlMapping
func ParseConfig ¶
func ParseConfig(conf []byte) YamlMapping
ParseConfig parses the contents of the provided yaml file into a YamlMapping structure
func ReadConfig ¶
func ReadConfig(fileName string) YamlMapping
ReadConfig creates a structured YamlMapping to use in tfvars, variables, modules, etc.