# Functions
CheckSHA256 returns an error if the hash of reader mismatches `sha`.
Checksum returns the sha1 sum of target file.
Copy copies a file or directory from src to dst.
FmtVer converts a version string to SemVer format, if the string is not a valid SemVer and fails to parse and convert it, an error is raised.
IsEmptyDir check whether a path is an empty directory.
IsExecBinary check whether a path is a valid executable.
IsExist check whether a path is exist.
IsNotExist check whether a path is not exist.
IsSubDir returns if sub is a sub directory of parent.
IsSymExist check whether a symbol link is exist.
IsTimeoutOrMaxRetry return true if it's timeout or reach max retry.
JoinHostPort return host and port.
MkdirAll basically copied from os.MkdirAll, but use max(parent permission,minPerm).
Move moves a file from src to dst, this is done by copying the file and then delete the old one.
NewHTTPClient returns a new HTTP client with timeout and HTTPS support.
ParseHostPort Prase host and port.
Retry retries the func until it returns no error or reaches attempts limit or timed out, either one is earlier.
RetryUntil when the `when` func returns true.
SaveFileWithBackup will backup the file before save it.
SHA256 returns the hash of reader.
SHA512 returns the hash of reader.
TailN try get the latest n line of the file.
Tar compresses the folder to tarball with gzip.
Ternary operator.
Untar decompresses the tarball.
UserHome returns home directory of current user.
WriteFile call os.WriteFile, but use max(parent permission,minPerm).
# Constants
LatestVersionAlias represents the latest build (excluding nightly versions).
NightlyVersionAlias represents latest build of master branch.
# Variables
ErrPropSuggestion is a property of an Error that will be printed as the suggestion.
ErrTraitPreCheck means that the Error is a pre-check error so that no error logs will be outputted directly.
ErrValidateChecksum is an empty HashValidationErr object, useful for type checking.
# Structs
HashValidationErr is the error indicates a failed hash validation.
HTTPClient is a wrap of http.Client.
RetryOption is options for Retry().
# Type aliases
No description provided by the author