Documentation ¶
Index ¶
- func ConvertPathsToAbsolutePaths(paths []string) ([]string, error)
- func FileExists(filename string) bool
- func IsDirectory(path string) (bool, error)
- func IsPathAbsolute(path string) bool
- func IsYaml(file string) bool
- func JoinAbsolutePathWithPaths(basePath string, paths []string) ([]string, error)
- func PrintAsJSON(data interface{}) error
- func PrintAsYAML(data interface{}) error
- func PrintError(err error)
- func PrintErrorToStdErrorAndExit(err error)
- func SliceContainsInt(s []int, i int) bool
- func SliceContainsString(s []string, str string) bool
- func SliceContainsStringStartsWith(s []string, str string) bool
- func SliceOfStringsToSpaceSeparatedString(s []string) string
- func StringKeysFromMap(m map[string]interface{}) []string
- func TrimBasePathFromPath(basePath string, path string) string
- func UniqueStrings(input []string) []string
- func WriteToFileAsJSON(filePath string, data interface{}, fileMode os.FileMode) error
- func WriteToFileAsYAML(filePath string, data interface{}, fileMode os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertPathsToAbsolutePaths ¶
ConvertPathsToAbsolutePaths converts a slice of paths to a slice of absolute paths
func FileExists ¶
FileExists checks if a file exists and is not a directory
func IsDirectory ¶
IsDirectory checks if the path is a directory
func IsPathAbsolute ¶ added in v1.4.0
func IsYaml ¶
IsYaml checks if the file has YAML extension (does not check file schema, nor validates the file)
func JoinAbsolutePathWithPaths ¶
JoinAbsolutePathWithPaths joins a base path with each item in the path slice and returns a slice of absolute paths
func PrintAsJSON ¶
func PrintAsJSON(data interface{}) error
PrintAsJSON prints the provided value as YAML document to the console
func PrintAsYAML ¶
func PrintAsYAML(data interface{}) error
PrintAsYAML prints the provided value as YAML document to the console
func PrintError ¶ added in v1.3.26
func PrintError(err error)
PrintError prints errors to std.Output
func PrintErrorToStdErrorAndExit ¶ added in v1.3.26
func PrintErrorToStdErrorAndExit(err error)
PrintErrorToStdErrorAndExit prints errors to std.Error and exits with an error code
func SliceContainsInt ¶
SliceContainsInt checks if an int is present in a slice
func SliceContainsString ¶
SliceContainsString checks if a string is present in a slice
func SliceContainsStringStartsWith ¶
SliceContainsStringStartsWith checks if a slice contains a string that the given string begins with
func SliceOfStringsToSpaceSeparatedString ¶
SliceOfStringsToSpaceSeparatedString checks if an int is present in a slice
func StringKeysFromMap ¶
StringKeysFromMap returns a slice of sorted string keys from the provided map
func TrimBasePathFromPath ¶
TrimBasePathFromPath trims the base path prefix from the path
func UniqueStrings ¶
UniqueStrings returns a unique subset of the string slice provided
func WriteToFileAsJSON ¶
WriteToFileAsJSON converts the provided value to YAML and writes it to the provided file
Types ¶
This section is empty.