Documentation
¶
Index ¶
- func CalculateFileMD5(filename string) (string, error)
- func CalculateSpeed(bytes int64, duration time.Duration) string
- func CreateFileWithDirs(filename string) (*os.File, error)
- func EnsureDir(dir string) error
- func FileExists(filename string) bool
- func FormatBytes(bytes int64) string
- func FormatDuration(d time.Duration) string
- func GetFileSize(filename string) (int64, error)
- func SanitizeFilename(filename string) string
- type ProgressBar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateFileMD5 ¶
CalculateFileMD5 calculates MD5 hash of file
func CalculateSpeed ¶
CalculateSpeed calculates transfer speed
func CreateFileWithDirs ¶
CreateFileWithDirs creates file, create directories if they don't exist
func FormatBytes ¶
FormatBytes formats bytes to human readable format
func FormatDuration ¶
FormatDuration formats time duration
func SanitizeFilename ¶
SanitizeFilename cleans filename, removes unsafe characters
Types ¶
type ProgressBar ¶
type ProgressBar struct {
// contains filtered or unexported fields
}
ProgressBar progress bar structure
func NewProgressBar ¶
func NewProgressBar(total int64, width int) *ProgressBar
NewProgressBar creates new progress bar
func (*ProgressBar) ETAString ¶
func (p *ProgressBar) ETAString() string
ETAString gets estimated remaining time
func (*ProgressBar) GetPercent ¶
func (p *ProgressBar) GetPercent() float64
GetPercent gets percentage
func (*ProgressBar) IsComplete ¶
func (p *ProgressBar) IsComplete() bool
IsComplete checks if complete
func (*ProgressBar) String ¶
func (p *ProgressBar) String() string
String returns string representation of progress bar
Click to show internal directories.
Click to hide internal directories.