Documentation
¶
Index ¶
- Variables
- func CleanEnvironmentStateFile(path string) error
- func CopyMap(m map[string]string) map[string]string
- func DeleteEnvironmentStateFile(path string) error
- func DiffMapsByKey(a, b map[string]string) map[string]string
- func DiffMapsByValue(a, b map[string]string) map[string]string
- func GetDifferenceBetweenStrings(a, b string) string
- func GetEnvironmentVariables() map[string]string
- func GetHomeDirectory() (string, error)
- func IsNumber(str string) bool
- func LoadEnvironmentStateFile(path string) (map[string]string, error)
- func Max(x, y int) int
- func MergeMaps(a, b map[string]string) map[string]string
- func OrderJsonFields(jsonStr string) (string, error)
- type ComparisonResult
Constants ¶
This section is empty.
Variables ¶
var DefaultEnvironmentStateFile = "/tmp/env-vars"
Location where the environment state from commands are to be captured and sent to for being able to share state across commands.
Functions ¶
func DeleteEnvironmentStateFile ¶
Deletes the stored environment variables file.
func DiffMapsByKey ¶
Compares two maps by key and returns the difference between the two. This comparison doesn't take into account the value of the key, only the presence of the key.
func DiffMapsByValue ¶
Compares two maps by key and returns the difference between the two based on the value of the key.
func GetEnvironmentVariables ¶
Get environment variables from the current process.
func GetHomeDirectory ¶
func LoadEnvironmentStateFile ¶
Loads a file that contains environment variables
func OrderJsonFields ¶
Types ¶
type ComparisonResult ¶
func CompareJsonStrings ¶
func CompareJsonStrings( actualJson string, expectedJson string, threshold float64, ) (ComparisonResult, error)
Compare two JSON strings by ordering the fields alphabetically and then comparing the strings using the Jaro-Winkler algorithm to compute a score. If the score is greater than the threshold, return true.