Documentation ¶
Index ¶
- Variables
- func FormatFileSize(bytes int64) string
- func FormatPercentage(current, total int64) string
- func FormatSpeed(bytes int64, totalMilliseconds int64) string
- type ProgressWriter
- type Utils
- func (u *Utils) ExtractTimestampFromFilename(filename string) (int64, error)
- func (u *Utils) GenerateTimestamp() int64
- func (u *Utils) ParseLink(link string) (string, string, string, error)
- func (u *Utils) SanitizePath(path string) string
- func (u *Utils) SetLogger(log logger.LoggerInterface)
- func (u *Utils) TrimLeadingSymbols(s string) string
- func (u *Utils) ZeroMemory(data []byte)
Constants ¶
This section is empty.
Variables ¶
View Source
var BufferPool = &sync.Pool{ New: func() interface{} { b := make([]byte, 4096) return &b }, }
Define a buffer pool globally to reuse buffers
Functions ¶
func FormatFileSize ¶
func FormatPercentage ¶
func FormatSpeed ¶
Types ¶
type ProgressWriter ¶
type ProgressWriter struct { Bar *uiprogress.Bar W io.Writer }
type Utils ¶
type Utils struct { PartsDir string Log logger.LoggerInterface }
func (*Utils) ExtractTimestampFromFilename ¶
func (*Utils) GenerateTimestamp ¶
func (*Utils) ParseLink ¶
ParseLink parses the given link and returns the resource name, query key, and query value.
func (*Utils) SanitizePath ¶
func (*Utils) SetLogger ¶
func (u *Utils) SetLogger(log logger.LoggerInterface)
func (*Utils) TrimLeadingSymbols ¶
func (*Utils) ZeroMemory ¶
Method to zero out the memory of a byte slice, to prevent the sensitive data from lingering in memory
Click to show internal directories.
Click to hide internal directories.