package
0.91.0
Repository: https://github.com/statping-ng/statping-ng.git
Documentation: pkg.go.dev

# Functions

CheckHash returns true if the password matches with a hashed bcrypt password.
CloseLogs will close the log file correctly on shutdown.
Command will run a terminal command with 'sh -c COMMAND' and return stdout and errOut as strings in, out, err := Command("sass assets/scss assets/css/base.css").
CreateDirectory will attempt to create a directory CreateDirectory("assets").
DeleteDirectory will attempt to delete a directory and all contents inside DeleteDirectory("assets").
DeleteFile will attempt to delete a file DeleteFile("newfile.json").
No description provided by the author
DurationReadable will return a time.Duration into a human readable string // t := time.Duration(5 * time.Minute) // DurationReadable(t) // returns: 5 minutes.
FileExists returns true if a file exists exists := FileExists("assets/css/base.css").
FileExtension returns the file extension based on a file path.
FolderExists will return true if the folder exists.
FormatDuration converts a time.Duration into a string.
GetLastLine returns 1 line for a recent log entry.
HashPassword returns the bcrypt hash of a password string.
HttpRequest is a global function to send a HTTP request // url - The URL for HTTP request // method - GET, POST, DELETE, PATCH // content - The HTTP request content type (text/plain, application/json, or nil) // headers - An array of Headers to be sent (KEY=VALUE) []string{"Authentication=12345", ...} // body - The body or form data to send with HTTP request // timeout - Specific duration to timeout on.
No description provided by the author
InitLogs will create the '/logs' directory and creates a file '/logs/statup.log' for application logging.
No description provided by the author
No description provided by the author
NewSHA1Hash returns a random SHA1 hash based on a specific length.
No description provided by the author
Now returns the UTC timestamp.
No description provided by the author
No description provided by the author
RandomString generates a random string of n length.
RenameDirectory will attempt rename a directory to a new name.
SaveFile will create a new file with data inside it SaveFile("newfile.json", []byte('{"data": "success"}').
No description provided by the author
No description provided by the author
No description provided by the author
NewSHA1Hash returns a random SHA1 hash based on a specific length.
ToFields accepts any amount of interfaces to create a new mapping for log.Fields.
ToInt converts a int to a string.
ToString converts a int to a string.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Variables

Directory returns the current path or the STATPING_DIR environment variable.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
Perlin is the noise generator.