Documentation ¶
Index ¶
- func AppendIfMissing(slice []string, s string) []string
- func AppendToSlice(trim bool, input, target []string) []string
- func CleanURLSpaces(dirtyStrings ...string) []string
- func CopyFiles(src, dest string) error
- func GenerateID() string
- func GenerateIDWithLen(i int) string
- func GenerateSecretIDWithParams(params ...string) string
- func GetEntropyInt(s string) float64
- func GetYamlFiles(dir string) ([]string, error)
- func Int64ToPointer(i int64) *int64
- func IsBinaryFile(filePath string) (bool, error)
- func IsMaxFileSize(filename string, maxFileSize int64) (bool, string)
- func IsTestFileOrPath(fullPath string) bool
- func MakeHomeDir(path string) (string, error)
- func MergeMaps(source, target map[string]int)
- func PathExists(path string) bool
- func Pluralize(count int, singular string, plural string) string
- func PointerToInt64(p *int64) int64
- func PointerToString(s *string) string
- func SetHomeDir(h string) (string, error)
- func StringToPointer(s string) *string
- func TruncateString(str string, maxLength int) string
- func WriteToFile(path string, input []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendIfMissing ¶
AppendIfMissing will check a slice for a value before appending it
func AppendToSlice ¶
AppendToSlice will append additional items to slice if not present already and return a new slice additional trim support is present, if necessary
func CleanURLSpaces ¶
CleanURLSpaces will take a string and replace any spaces with dashes so that is may be used in a url.
func CopyFiles ¶
CopyFiles will copy files from src to dest directory and attempt to set correct permissions
func GenerateID ¶
func GenerateID() string
GenerateID will create an ID for each finding based up the SHA1 of discrete data points associated with the finding.
func GenerateIDWithLen ¶
func GetEntropyInt ¶
get EntropyInt will calculate the entrophy based upon Shannon Entropy
func GetYamlFiles ¶
GetYamlFiles will find all the yaml files in the provided directory path and return a string slice with all findings
func Int64ToPointer ¶
func IsBinaryFile ¶
func IsMaxFileSize ¶
IsMaxFileSize will determine if the file size is under the max limit set by maxFileSize
func IsTestFileOrPath ¶
IsTestFileOrPath will run various regex's against a target to determine if it is a test file or contained in a test directory.
func MakeHomeDir ¶
func PathExists ¶
TODO THIS FUNC HAS TO RETURN ERROR, OTHERWISE WE DO THE SAME CHECK AGAIN LATER PathExists will check if a path exists or not and is used to validate user input
func Pluralize ¶
Pluralize will take in a count and if the count is != 1 it will return the singular of the word.
func PointerToInt64 ¶
func PointerToString ¶
func SetHomeDir ¶
SetHomeDir will set the correct homedir.
func StringToPointer ¶
func TruncateString ¶
TruncateString will take an integer and cut a string at that length and append an ellipsis to it.
func WriteToFile ¶
WriteToFile will create a new file or truncate the existing one and write the input byte stream.
Types ¶
This section is empty.