Documentation ¶
Overview ¶
Package fs handle the fileSystem part of terraform-validator (Files and Directories)
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSubFolderList ¶
GetSubFolderList returns you the list of folders inside pathF
func ListTerraformFiles ¶
ListTerraformFiles get the terraform file list in the given pathF
Example ¶
package main import ( "fmt" "github.com/thazelart/terraform-validator/internal/fs" ) func main() { path := "../../testdata/ok_default_config" var fileList []string fileList = fs.ListTerraformFiles(path) fmt.Printf("%v", fileList) }
Output:
Types ¶
type File ¶
File is a simple structure to permit fs function overriding in others terraform-validator subpackages. It contains the file Path and it's content in []byte.
func (File) FileEqual ¶
FileEqual ensures that the two files have the same content
Example ¶
package main import ( "fmt" "github.com/thazelart/terraform-validator/internal/fs" ) func main() { file1 := fs.NewFile("my_file.txt") file2 := fs.NewFile("another_one.txt") result := file1.FileEqual(file2) fmt.Printf("It is %t to say that my files are equals !", result) }
Output:
func (File) GetFilename ¶
GetFilename return you the filename instead of it's full path
type Folder ¶
Folder is a simple structure to permit fs function overriding in others terraform-validator subpackages
func NewTerraformFolder ¶
NewTerraformFolder return you a Folder var that contains all the Terraform files in the given pathF
Example ¶
package main import ( "fmt" "github.com/thazelart/terraform-validator/internal/fs" ) func main() { path := "../../testdata/ok_default_config" folder := fs.NewTerraformFolder(path) fmt.Printf("%+v", folder) }
Output: