helpers

package
v0.0.0-...-cbd5ca3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package helpers contains some helper functions which the HULK CL program needs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDir

func CheckDir(dir string) error

CheckDir is a function to check that a directory exists

func CheckExt

func CheckExt(file string, exts []string) error

CheckExt is a function to check the extensions of a file

func CheckFile

func CheckFile(file string) error

CheckFile is a function to check that a file can be read

func CheckRequiredFlags

func CheckRequiredFlags(flags *pflag.FlagSet) error

a function to check for required flags

func CheckSTDIN

func CheckSTDIN() error

CheckSTDIN is a function to check that STDIN can be read

func CollectJSONs

func CollectJSONs(inputDir string, recursive bool) ([]string, error)

CollectJSONs is a function to find all JSON files in a directory and return a list of file names

func ErrorCheck

func ErrorCheck(msg error)

a function to throw error to the log and exit the program

func FanOutUnbuffered

func FanOutUnbuffered(inputChannel chan uint64, numOutputChannels int) []chan uint64

FanOutUnbuffered is a helper function to set up a fanout concurrency pattern

func FloatSlice2string

func FloatSlice2string(floatSlice []float64, sep string) string

FloatSlice2string converts []float64 to a string, with a custom delimiter to separate slice values

func MD5sum

func MD5sum(data []uint64) [16]byte

MD5sum will return the MD5sum of a []uint64

func Pow

func Pow(a, b uint) uint

Pow is a function to raise a to the power of b

func StartLogging

func StartLogging(logFile string) *os.File

StartLogging is a function to start the log...

Types

This section is empty.

Jump to

Keyboard shortcuts

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