filesystem

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreEnvVarsConsistent

func AreEnvVarsConsistent(envVars EnvVars) error

AreEnvVarsConsistent checks if the environment variables have non-empty values.

func AreEnvVarsExportedAndSet

func AreEnvVarsExportedAndSet(keys []string) error

AreEnvVarsExportedAndSet IsEnvVarSetOrExported checks if the environment variable exist, and also if it is exported or set.

func AreEnvVarsSet

func AreEnvVarsSet(keys []string) error

AreEnvVarsSet checks if the environment variables have non-empty values.

func DirExist

func DirExist(dir string) error

func DirIsNotEmpty

func DirIsNotEmpty(dir string) error

func DirIsValid

func DirIsValid(dir string) error

func DoEnvVarsExist

func DoEnvVarsExist(keys []string) error

DoEnvVarsExist checks if the environment variables exist.

func FileExist

func FileExist(filePath string) error

func GetEnvVarsFromDotFile added in v0.2.2

func GetEnvVarsFromDotFile(filepath string) (map[string]string, error)

func IsGitRepository added in v0.2.7

func IsGitRepository(path string, checkUntilRoot bool, checkRecursivelyUntilIsFound bool) (string, error)

func IsPathAbsolute added in v0.2.4

func IsPathAbsolute(path string) error

func IsPathRelative added in v0.2.7

func IsPathRelative(path string) error

func IsRelativeChildPath added in v0.2.7

func IsRelativeChildPath(parentPath string, childPath string) error

func IsSubDir

func IsSubDir(parentDir string, childDir string) error

func PathExist

func PathExist(path string) (os.FileInfo, error)

func PathIsADirectory

func PathIsADirectory(path string) error

func PathToAbsolute

func PathToAbsolute(path string) (string, error)

Types

type EnvVars

type EnvVars map[string]string

func FetchAWSEnvVars

func FetchAWSEnvVars() (EnvVars, error)

FetchAWSEnvVars fetches environment variables that start with the prefix "AWS_"

func FetchAllEnvVarsFromHost added in v0.2.2

func FetchAllEnvVarsFromHost() (EnvVars, error)

func FetchEnvVarsAsMap

func FetchEnvVarsAsMap(keys []string, optionalKeys []string) (EnvVars, error)

FetchEnvVarsAsMap checks if the environment variables exist and returns them as a map.

func FetchEnvVarsWithPrefix

func FetchEnvVarsWithPrefix(prefix string) (EnvVars, error)

FetchEnvVarsWithPrefix fetches environment variables that start with the specified prefix and returns an error if any of the variables either do not exist or have an empty value.

func MergeEnvVars

func MergeEnvVars(envVars ...EnvVars) EnvVars

func ScanAWSCredentialsEnvVars

func ScanAWSCredentialsEnvVars() (EnvVars, error)

ScanAWSCredentialsEnvVars scans the environment variables for AWS credentials.

func ScanEnvVarsFromPrefixes added in v0.2.8

func ScanEnvVarsFromPrefixes(prefixes []string) (EnvVars, error)

ScanEnvVarsFromPrefixes scans the environment variables for the specified prefixes.

func ScanTerraformEnvVars

func ScanTerraformEnvVars() (EnvVars, error)

ScanTerraformEnvVars fetches environment variables that start with the prefix "TF_VAR_"

Jump to

Keyboard shortcuts

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