utils

package
v0.0.0-...-020d709 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONST_BASE_DATA_DIR   = "data"    // 下载数据目录
	CONST_BASE_TMP_DIR    = ".tmp"    // 临时数据目录
	CONST_BASE_OS_TMP_DIR = "pulldlr" // 临时数据目录
)

Variables

This section is empty.

Functions

func CleanSliceUselessData

func CleanSliceUselessData(sliceData []byte) (result []byte)

清理分片文件中的无用数据,影响分片合并后的播放

func CleanTmpFile

func CleanTmpFile() error

清理系统级临时文件,返回一个文件句柄

func CopyFile

func CopyFile(sourceFile string, distFile string) (err error)

func CreateTmpFile

func CreateTmpFile() (tmpFile *os.File, err error)

创建系统级临时文件,返回一个文件句柄

func DownloadeSliceFile

func DownloadeSliceFile(url string, filePath string, decryptKey string) (result string, err error)

下载http链接的分片文件到本地磁盘,如果是加密文件请传递加密密钥 @param url string 链接地址

func DrawProgressBar

func DrawProgressBar(prefix string, proportion float32, width int, suffix ...string)

func GetBaseUrl

func GetBaseUrl(srcUrl string) string

func GetDownloadDataDir

func GetDownloadDataDir() string

获取下载文件目录

func GetDownloadTmpDir

func GetDownloadTmpDir() string

获取临时文件目录

func GetMD5

func GetMD5(str string) string

func HttpGetFile

func HttpGetFile(url string) ([]byte, error)

func Logger

func Logger() *zerolog.Logger

func LoggerDebug

func LoggerDebug(msg string)

func LoggerError

func LoggerError(msg string)

func LoggerInfo

func LoggerInfo(msg string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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