package
0.0.0-20240216081233-64e3f117d238
Repository: https://github.com/dfroberg/metrics-agent.git
Documentation: pkg.go.dev

# Functions

CheckIfDirEmpty checks if a directory is empty, returning an ErrEmptyDataDir error if it is.
CheckRequiredSettings checks for required min values / flags / environment variables.
CopyFileContents copies the contents of the file named src to the file named by dst.
CreateMetricSample creates a metric sample from a given directory removing the source directory if cleanup is true.
CreateMSWorkingDirectory takes a given prefix and returns a metric sample working directory.
IsValidURL returns true if string is a valid URL.
MatchOneFile returns the name of one file based on a given directory and pattern returning an error if more or less than one match is found.
SafeClose will close the given closer function, setting the err ONLY if it is currently nil.
SetupLogger sets configuration for the default logger.
TestHTTPConnection takes a given client / URL(string) / bearerToken(string)/ retries count (int) and returns true if response code is 2xx.
ValidateScratchDir validates whether or not the scratch directory exists or not.

# Variables

ErrEmptyDataDir error to indicate the data directory is empty.