util

package
v0.0.0-...-57b748c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MemUnit         = 1024
	SHA256Algorithm = "sha256"
	MD5Algorithm    = "md5"
)

Variables

This section is empty.

Functions

func CreateDir

func CreateDir(folderName string, dirPath string)

Create dir in current directory.

func DeleteFile

func DeleteFile(name string)

func FileExists

func FileExists(name string) bool

func FileIntegrityCheck

func FileIntegrityCheck(hashFunc string, path string, expected string) bool

func GenHash

func GenHash(s string, threadCount int) string

func GetFormattedSize

func GetFormattedSize(size float64) string

func SegmentFilePath

func SegmentFilePath(session string, fileID int) string

* Segments are stored in side the temproary directory above, * there are n segments, n represents threadcount. if thread = 10 * there will be 10 segments in the temp folder.

func TempDirectory

func TempDirectory(session string) string

Create a directory with session ID, Session ID is hash of URL and threadcount.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL