http_utils

package
v0.2.88 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(url string, filePath string, showProgress bool) error

下载文件,需要指定具体的文件路径而不是文件夹路径

Types

type ProgressReader

type ProgressReader struct {
	Reader       io.Reader
	Total        int64
	Downloaded   int64
	LastProgress int
}

ProgressReader 结构体用于跟踪下载进度

func (*ProgressReader) Read

func (pr *ProgressReader) Read(p []byte) (int, error)

Read 方法重写,增加进度条功能

Jump to

Keyboard shortcuts

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