modulepackage
0.0.0-20230404143020-51a25f54cce7
Repository: https://github.com/xorpaul/gohelper.git
Documentation: pkg.go.dev
# Functions
No description provided by the author
checkDirAndCreate tests if the given directory exists and tries to create it.
No description provided by the author
Debugf is a helper function for Debug logging if global variable Debug is set to true.
DetectBrowserOrCLI checks for the existance of a User-Agent request header and primitivly tries to check if the request was made from a browser or from a CLI, like wget or curl and returns either "plain" if a CLI was detected or "html" if a browser was detected.
No description provided by the author
Fatalf is a helper function for fatal logging.
FileExists checks if the given file exists and returns a bool.
funcName return the function name as a string.
GetRequestClientIp extract the client IP address from the request with support for X-Forwarded-For header when the request is originating from proxied networks.
getSha256sumFile return the SHA256 hash sum of the given file.
No description provided by the author
Infof is a helper function for Info logging if global variable Info is set to true.
isDir checks if the given dir exists and returns a bool.
No description provided by the author
NormalizeDir removes from the given directory path multiple redundant slashes and adds a trailing slash.
No description provided by the author
No description provided by the author
randSeq returns a fixed length random string to identify each request in the log http://stackoverflow.com/a/22892986/682847.
No description provided by the author
No description provided by the author
Verbosef is a helper function for Verbose logging if global variable Verbose is set to true.
Warnf is a helper function for warning logging.
No description provided by the author
# Variables
Debug variable to toggle debug output.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Verbose variable to toggle verbose output.
No description provided by the author
# Structs
ExecResult contains the exit code and output of an external command (e.g.