block

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

* @Author: nijineko * @Date: 2024-04-12 19:58:14 * @LastEditTime: 2024-04-12 22:27:45 * @LastEditors: nijineko * @Description: 下载文件块 * @FilePath: \Miyako\pkg\block\download.go

* @Author: nijineko * @Date: 2024-04-12 17:53:08 * @LastEditTime: 2024-04-12 20:15:01 * @LastEditors: nijineko * @Description: 创建文件块 * @FilePath: \Miyako\pkg\block\generate.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(FolderPath string) (*catalog.Catalog, error)

*

  • @description: 创建一个文件块
  • @param {string} FolderPath 文件夹路径
  • @return {*Catalog} catalog
  • @return {error} 错误

Types

type Download

type Download struct {
	BlockResponse *http.Response
	CatalogData   *catalog.Catalog
	SavePath      string
	TotalSize     int64
}

func NewDownload

func NewDownload(BlockURL string, CatalogData *catalog.Catalog, SavePath string) (*Download, error)

*

  • @description: 创建一个新的块下载
  • @param {string} BlockURL 文件块地址
  • @param {*catalog.Catalog} CatalogData Catalog数据
  • @param {string} SavePath 保存路径
  • @return {*Download} 下载对象

func (*Download) Close

func (d *Download) Close()

*

  • @description: 关闭块下载

func (*Download) Start

func (d *Download) Start(Progress func(WrittenSize int64, TotalSize int64)) error

*

  • @description: 开始下载文件块
  • @return {*error} 错误

Jump to

Keyboard shortcuts

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