utils

package
v0.0.0-...-02ab0c4 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MaxUint16 = ^uint16(0)
View Source
const MaxUint16AsUint32 = uint32(MaxUint16)
View Source
const MaxUint32 = ^uint32(0)

Variables

This section is empty.

Functions

func AskForConfirmation

func AskForConfirmation(message string) bool

Ask User for Confirmation From https://gist.github.com/albrow/5882501

func CreateDir

func CreateDir(dirname string)

CreateDir creates a new Directory

func DirectoryExists

func DirectoryExists(directoryPath string) bool

DirectoryExists returns whether a Directory exists

func ExpandIntegerList

func ExpandIntegerList(str string) []uint16

ExpandIntegerList returns from a string all integers in this range e.g. 2-5,12 will return 2,3,4,5,12

func FileExists

func FileExists(filename string) bool

FileExists returns whether a File exists

func GetDistributionStats

func GetDistributionStats(values []int) (mean float64, min, max int, stdDev float64)

func GetFilename

func GetFilename(filePath string, withExtension bool) string

Returns the filename of a path.

func GetFilesInPath

func GetFilesInPath(inputDirectory, extensionWithoutDot string) []string

GetFilesInPath returns the complete path to all files in the inputDirectory which do have the required extension. Skips subdirectories

func GetPcapFiles

func GetPcapFiles(input string) []string

GetPcapFiles returns all pcap files specified

func IsZipFile

func IsZipFile(filename string) (isZipFile bool)

Returns whether the given file is a .bz2 zip file

func PrintMemUsage

func PrintMemUsage()

PrintMemUsage outputs the current, total and OS memory being used. As well as the number of garage collection cycles completed. Adopted from: https://golangcode.com/print-the-current-memory-usage/

func Unzip

func Unzip(filename string) (unzippedFileName string)

Unzips a zip file and returns the filename of the unzipped file

Types

This section is empty.

Jump to

Keyboard shortcuts

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