package
0.3.0
Repository: https://github.com/enverbisevac/gitlib.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

AESGCMDecrypt (from legacy package): decrypts ciphertext with the given key using AES in GCM mode.
AESGCMEncrypt (from legacy package): encrypts plaintext with the given key using AES in GCM mode.
No description provided by the author
CommonSkip will check a provided name to see if it represents file or directory that should not be watched.
CryptoRandomBytes generates `length` crypto bytes This differs from CryptoRandomString, as each byte in CryptoRandomString is generated by [0,61] range This function generates totally random bytes, each byte is generated by [0,255] range.
CryptoRandomInt returns a crypto random integer between 0 and limit, inclusive.
CryptoRandomString generates a crypto random alphanumerical string, each byte is generated by [0,61] range.
Dedent removes common indentation of a multi-line string along with whitespace around it Based on https://github.com/lithammer/dedent.
EnsureAbsolutePath ensure that a path is absolute, making it relative to absoluteBase if necessary.
ExistsInSlice returns true if string exists in slice.
FileURLToPath extracts the path information from a file://..
GetDirectorySize returns the disk consumption for a given path.
HomeDir returns path of '~'(in Linux) on Windows, it returns error when the variable does not exist.
IsDir returns true if given path is a directory, or returns false when it's a file or does not exist.
IsEmptyString checks if the provided string is empty.
IsEqualSlice returns true if slices are equal.
IsExist checks whether a file or directory exists.
IsFile returns true if given path is a file, or returns false when it's a directory or does not exist.
IsInt64InSlice sequential searches if int64 exists in slice.
IsSliceInt64Eq returns if the two slice has the same elements but different sequences.
IsStringInSlice sequential searches if string exists in slice.
Max max of two ints.
MergeInto merges pairs of values into a "dict".
Min min of two ints.
NormalizeEOL will convert Windows (CRLF) and Mac (CR) EOLs to UNIX (LF).
NumberIntoInt64 transform a given int into int64.
OptionalBoolOf get the corresponding OptionalBool of a bool.
OptionalBoolParse get the corresponding OptionalBool of a string using strconv.ParseBool.
PaginateSlice cut a slice as per pagination options if page = 0 it do not paginate.
PathEscapeSegments escapes segments of a path while not escaping forward slash.
ReadAtMost reads at most len(buf) bytes from r into buf.
Remove removes the named file or (empty) directory with at most 5 attempts.
RemoveAll removes the named file or (empty) directory with at most 5 attempts.
RemoveIDFromList removes the given ID from the slice, if found.
Rename renames (moves) oldpath to newpath with at most 5 attempts.
SanitizeCredentialURLs remove all credentials in URLs (starting with "scheme://") for the input string: "https://user:[email protected]" => "https://[email protected]".
SanitizeErrorCredentialURLs wraps the error and make sure the returned error message doesn't contain sensitive credentials in URLs.
SecToTime converts an amount of seconds to a human-readable string.
SetOf creates a set and adds the specified elements to it.
ShellEscape will escape the provided string.
SplitStringAtByteN splits a string at byte n accounting for rune boundaries.
SplitStringAtRuneN splits a string at rune n accounting for rune boundaries.
StatDir gathers information of given directory by depth-first.
StopTimer is a utility function to safely stop a time.Timer and clean its channel.
ToSnakeCase convert the input string to snake_case format.
ToTitleCase returns s with all english words capitalized.
ToUpperASCII returns s with all ASCII letters mapped to their upper case.
URLJoin joins url components, like path.Join, but preserving contents.

# Constants

OptionalBoolFalse a "false" boolean value.
OptionalBoolNone a "null" boolean value.
OptionalBoolTrue a "true" boolean value.

# Variables

Common Errors forming the base of our error system Many Errors returned by Gitea can be tested against these errors using errors.Is.
Common Errors forming the base of our error system Many Errors returned by Gitea can be tested against these errors using errors.Is.
Common Errors forming the base of our error system Many Errors returned by Gitea can be tested against these errors using errors.Is.
Common Errors forming the base of our error system Many Errors returned by Gitea can be tested against these errors using errors.Is.

# Type aliases

Int64Slice attaches the methods of Interface to []int64, sorting in increasing order.
OptionalBool a boolean that can be "null".
No description provided by the author