Documentation
¶
Index ¶
- Constants
- func Bytes(s uint64) string
- func CalculateSHA256Checksum(filePath string) (string, error)
- func CheckFullPath(path string) bool
- func CheckLinuxPath(path string) bool
- func CheckWindowsPath(path string) bool
- func ChmodR(path string, filePerm, dirPerm os.FileMode) error
- func CopyFile(src string, dst string) error
- func DeflateBuf(data []byte) []byte
- func Exist(filePath string) bool
- func ExtractTarGz(gzipPath string, dest string) error
- func ForceRemoveAll(rootPath string) error
- func FormatWindowPath(path string) string
- func GetExtensionByBytes(data []byte) (string, error)
- func GetExtensionByPath(filepath string) (string, error)
- func IBytes(s uint64) string
- func MoveDirectory(sourceDir, destDir string) error
- func MoveFile(sourcePath, destPath string) error
- func ParseBytes(s string) (uint64, error)
- func ReadFileFromTarGz(tarGzFile string, tarPath string) ([]byte, error)
- func RemoveFile(filePath string) error
- func ResolvePath(in string) string
- func UnzipOneWithBytes(content []byte) ([]byte, error)
Constants ¶
const ( Byte = 1 << (iota * 10) KiByte MiByte GiByte TiByte PiByte EiByte )
IEC Sizes. kibis of bits
const ( IByte = 1 KByte = IByte * 1000 MByte = KByte * 1000 GByte = MByte * 1000 TByte = GByte * 1000 PByte = TByte * 1000 EByte = PByte * 1000 )
SI Sizes.
Variables ¶
This section is empty.
Functions ¶
func Bytes ¶
Bytes produces a human readable representation of an SI size.
See also: ParseBytes.
Bytes(82854982) -> 83 MB
func CalculateSHA256Checksum ¶
func CheckFullPath ¶ added in v0.1.0
func CheckLinuxPath ¶ added in v0.1.0
func CheckWindowsPath ¶ added in v0.1.0
func DeflateBuf ¶
DeflateBuf - Deflate a buffer using BestCompression (9)
func ExtractTarGz ¶
ExtractTarGz extracts a .tar.gz file to the specified destination directory
func ForceRemoveAll ¶
func FormatWindowPath ¶
func GetExtensionByBytes ¶ added in v0.1.1
func GetExtensionByPath ¶ added in v0.1.1
func IBytes ¶
IBytes produces a human readable representation of an IEC size.
See also: ParseBytes.
IBytes(82854982) -> 79 MiB
func MoveDirectory ¶
func ParseBytes ¶
ParseBytes parses a string representation of bytes into the number of bytes it represents.
See Also: Bytes, IBytes.
ParseBytes("42 MB") -> 42000000, nil ParseBytes("42 mib") -> 44040192, nil
func ReadFileFromTarGz ¶
ReadFileFromTarGz - Read a file from a tar.gz file in-memory
func ResolvePath ¶
ResolvePath - Resolve a path from an assumed root path
func UnzipOneWithBytes ¶ added in v0.1.0
Types ¶
This section is empty.