Documentation ¶
Index ¶
- Constants
- func Exists(path string) bool
- func FatalCheck(err error)
- func FilenameWithHash(url string) string
- func FilenameWithoutHash(url string) string
- func FolderOf(url string) string
- func HashOf(str string) string
- func IsURL(URL string) bool
- func MakePartName(part int64, parallelism int64) string
- func MkdirIfNotExist(folder string) error
- func ReadableMemorySize(bytes int64) string
- func ResolveURL(URL string) (string, error)
Constants ¶
View Source
const ( Byte = 1 KiloByte = 1024 * Byte MegaByte = 1024 * KiloByte GigaByte = 1024 * MegaByte TeraByte = 1024 * GigaByte )
Variables ¶
This section is empty.
Functions ¶
func FilenameWithHash ¶
FilenameWithHash returns the hash-basename from the url.
func FilenameWithoutHash ¶
FilenameWithoutHash returns the basename of the url.
func MakePartName ¶
MakePartName creates the part name with the part number formatted with as many leading zeros as needed. For example, MakePartName(0, 100) = "part.00", MakePartName(100, 100) = "part.99" and MakePartName(101, 101) = "part.100".
func MkdirIfNotExist ¶
MkdirIfNotExist makes a directory with perm 0700 if not exists.
func ReadableMemorySize ¶
ReadableMemorySize returns a prettier form of some memory size.
func ResolveURL ¶
ResolveURL resolves the url adding the http scheme going for https-first if needed.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.