Documentation ¶
Index ¶
- func ByteCountIEC(b int64) string
- func ByteCountSI(b int64) string
- func CompareData(data, toFind string) bool
- func CompareDataInsensitive(data, toFindLower string) bool
- func CountLine(filename string) int
- func CreateJSON(values ...string) string
- func ExportMetrics() []byte
- func ExtractString(data *string, first, last string) string
- func FilterFromFile(filename string, maxLinesToSearch int, toFilter string, reverse bool) string
- func FilterFromFileCompress(filename string, maxLinesToSearch int, toFilter string, reverse bool) []byte
- func FreeSystemMemory(gcSleep *int)
- func GetFileDate(filepath string) string
- func GetFileModification(filepath string) int64
- func GetFileSizeC(filename string) int64
- func IsASCII(s string) bool
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsUpper(str string) bool
- func Join(strs ...string) string
- func JoinArray(data []string) string
- func Lz4CompressData(fileContent string) ([]byte, int)
- func Lz4DecompressData(compressedData []byte, l int)
- func ParseDate2(strdate string) int64
- func Random(min int, max int) int
- func ReadAllFile(filePath string) string
- func ReadAllFileInArray(filePath string) []string
- func ReadFile(filename string, lines int) []byte
- func ReadFileContentC(filename string) string
- func ReadFilePath(path string) []string
- func RecognizeFormat(input string) (string, string)
- func RemoveElement(data []string, j []int) []string
- func RemoveFromString(s []byte, i int) []byte
- func RemoveWhiteSpaceArray(data []string) []string
- func RemoveWhiteSpaceString(str string) string
- func RetrieveLines(fileContet string) int
- func SecureRequest(ctx *fasthttp.RequestCtx, ssl bool)
- func SetDebugLevel(level string) log.Level
- func SpellCheck(filepath, wrongword string) string
- func SplitStringInArray(data string) []string
- func StartCPUProfiler(file *os.File)
- func ValidateInjection(payload string, mustContain []string) bool
- func VerifyCert(filePath, pub, priv string) bool
- func VerifyFilesExists(filePath string, files []string) bool
- func VerifyIfPresent(content string, entryList []string) bool
- type Monitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteCountIEC ¶
ByteCountIEC convert the byte in input to MB/KB/TB ecc
func ByteCountSI ¶
ByteCountSI convert the byte in input to MB/KB/TB ecc
func CompareData ¶
CompareData is Golang wrapper for the C method delegated to verify if the given target is present in the data
func CompareDataInsensitive ¶
CompareDataInsensitive call the C function delegated to 'lowerize' the string and find the first occurence
func CountLine ¶
CountLine return the number of line for a given file using the "wc" shell utils (CPU hungry)
func CreateJSON ¶
CreateJSON is delegated to create a json object for the key pair in input
func ExportMetrics ¶
func ExportMetrics() []byte
ExportMetrics is in charge to retrive the information related to the resources used
func ExtractString ¶
ExtractString is delegated to filter the content of the given data delimited by 'first' and 'last' string
func FilterFromFile ¶
FilterFromFile return the text that containt "toFilter" from the file "filename" in a zipped format TODO: Write the method in C using FSEEK instead of line
func FilterFromFileCompress ¶
func FilterFromFileCompress(filename string, maxLinesToSearch int, toFilter string, reverse bool) []byte
FilterFromFileCompress return the text that containt "toFilter" from the file "filename" in a zipped format
func FreeSystemMemory ¶
func FreeSystemMemory(gcSleep *int)
FreeSystemMemory Call the garbage collector every "gcSleep" minutes
func GetFileDate ¶
GetFileDate is delegated to return the date in a string format in which the file was (latest) modified
func GetFileModification ¶
GetFileModification return the last modification time of the file in input in a UNIX time format
func GetFileSizeC ¶
GetFileSizeC wrapper method for retrieve byte lenght of a file
func Lz4CompressData ¶
Lz4CompressData is delegated to compress the input string data using the lz4 algorithm. It return the compressed data itself and the lenght of the compressed data.
func Lz4DecompressData ¶
Lz4DecompressData is delegated to extract the previously compressed data
func ParseDate2 ¶
ParseDate2 is an hardcoded parser for date like 31/01/2019 13:29:37,932. Than, return the nanoseceond since Unix epoch
func Random ¶
Random initalizate a new seed using the UNIX Nano time and return an integer between the 2 input value
func ReadAllFile ¶
ReadAllFile is delegated to read and return all the content of the given file
func ReadAllFileInArray ¶
ReadAllFileInArray is delegated to read the file content as tokenize the data by the new line
func ReadFile ¶
ReadFile is in charge to read the last number of lines for a given file and return the content in a compressed format
func ReadFileContentC ¶
ReadFileContentC wrapper method for retrieve content by a file
func ReadFilePath ¶
ReadFilePath is delegated to filter every (sub)file path from a given directory
func RecognizeFormat ¶
RecognizeFormat is delegated to valutate the extension and return the properly Mimetype by a given format type reurn: (Mimetype http compliant,Content-Disposition header value)
func RemoveElement ¶
RemoveElement delete the element of the indexes contained in j of the data in input
func RemoveFromString ¶
RemoveFromString Remove a given element from a string
func RemoveWhiteSpaceArray ¶
RemoveWhiteSpaceArray is delegated to iterate every array row and remove the whitespace from the given string
func RemoveWhiteSpaceString ¶
RemoveWhiteSpaceString is delegated to remove the whitespace from the given string
func RetrieveLines ¶
RetrieveLines return the number of lines in the given string
func SecureRequest ¶
func SecureRequest(ctx *fasthttp.RequestCtx, ssl bool)
SecureRequest is delegate to set the necessary secure headers NOTE: CORS is set to '*', be sure to rewrite the headers when expose the application
func SetDebugLevel ¶
SetDebugLevel return the LogRus object by the given string
func SpellCheck ¶
SpellCheck is a Go wrapper for the C spell check algorithm
func SplitStringInArray ¶
SplitStringInArray is delegated to split the string by the new line
func StartCPUProfiler ¶
StartCPUProfiler Save the cpu profile information into the given file NOTE: Remember to defer pprof.StopCPUProfile() after the function
func ValidateInjection ¶
ValidateInjection provide commons methods for validate a given payload
func VerifyCert ¶
VerifyCert is delegated to verify that the given public and private cert exist in the filepath
func VerifyFilesExists ¶
VerifyFilesExists is delegated to verify that the given list of file exist in the directory
func VerifyIfPresent ¶
VerifyIfPresent Verify if a given string is present in the list