utils

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsStringInFile

func ContainsStringInFile(file io.Reader, target string, caseInsensitive bool) (bool, error)

ContainsStringInFile checks if the given file contains the given string

func FileExists

func FileExists(searchPath, name string) bool

FileExists checks if the file exists

func FindAllFiles

func FindAllFiles(searchPath, name string) []string

FindAllFiles searches for the file inside the path recursively and returns all matches

func FindFile

func FindFile(searchPath, name string) string

FindFile searches for the file inside the path recursively and returns the full path of the file if found If multiple files exist, tries to return the one closest to root

func GetJSONValue added in v0.1.2

func GetJSONValue(keyPath []string, filePath string, caseInsensitive bool) (value interface{}, ok bool)

GetJSONValue gets a value from a JSON file, by traversing the path given

func GetMapValue added in v0.1.2

func GetMapValue(keyPath []string, data map[string]interface{}) (value interface{}, ok bool)

func GetTOMLValue added in v0.1.2

func GetTOMLValue(keyPath []string, filePath string, caseInsensitive bool) (value interface{}, ok bool)

GetTOMLValue gets a value from a TOML file, by traversing the path given

Types

This section is empty.

Jump to

Keyboard shortcuts

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