Documentation ¶
Index ¶
Constants ¶
View Source
const ( B = 1 << (iota * 10) KB MB GB TB )
Variables ¶
View Source
var ( // ErrDownloadNotExist is an error thrown when trying to fetch an inexistent download. ErrDownloadNotExist = errors.New("download does not exist") // ErrDownloadBroken is an error thrown when trying to fetch a broken download. ErrDownloadBroken = errors.New("download is broken") // ErrFilenameEmpty is an error thrown when a cleaned download filename is empty. ErrFilenameEmpty = errors.New("filename is empty") // ErrFilenameTooLong is an error thrown when a download filename is too long. ErrFilenameTooLong = errors.New("filename is too long") )
Functions ¶
func CheckFilenameValidity ¶ added in v1.0.0
CheckFilenameValidity checks if a filename is valid. If it is not, returns an error.
func ConsoleCancelableContext ¶ added in v1.0.0
ConsoleCancelableContext creates a context that can be canceled from the console. For example, by typing Ctrl + C.
func ReadableMemorySize ¶
ReadableMemorySize returns a prettier form of some memory size expressed in bytes. Note: Do not exceed the float64 limit, as the result will overflow.
func ResolveURL ¶
ResolveURL resolves the rawURL adding the http prefix, preferring https over http.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.