Documentation ¶
Index ¶
- func ArrContainsStr(array []string, str string) bool
- func Convert[T any](value string, convertor func(string) (T, error), defaultValue ...T) (*T, error)
- func ConvertBytesToHumanReadableSize(bytes int) string
- func CopyIOZeroAlloc(w io.Writer, r io.Reader) (int64, error)
- func FilePathToIOReader(filePath string) (io.Reader, error)
- func GenXid() string
- func HumanReadableSizeToBytes(humanReadableString string) int
- type DataEncryptionUtils
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrContainsStr ¶
ArrContainsStr checks if a string is in a string array
func ConvertBytesToHumanReadableSize ¶
ConvertBytesToHumanReadableSize converts the given integer size in bytes to a human-readable string format. If the size is 0, it returns "0B". It uses the logarithmic calculation to determine the appropriate unit prefix (e.g., KB, MB, GB, etc.), and formats the value with two decimal places before appending the unit suffix. The units slice contains the available unit prefixes: ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]. Note: The function assumes that the given size is a positive integer.
func HumanReadableSizeToBytes ¶
HumanReadableSizeToBytes returns integer size of bytes from human-readable string, ex. 42kb, 42M Returns 0 if string is unrecognized
Types ¶
type DataEncryptionUtils ¶
type DataEncryptionUtils struct {
// contains filtered or unexported fields
}
func UseEncryption ¶
func UseEncryption(key string) *DataEncryptionUtils