bdtools

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 分片大小,4MB,普通用户的最大分片大小
	ChunkSize = 4 * 1024 * 1024
)

Variables

This section is empty.

Functions

func BatchGetFileInfos

func BatchGetFileInfos(accessToken string, fsids []uint64) ([]*bdpan.FileInfo, error)

func DownloadFileToLocal

func DownloadFileToLocal(accessToken string, f *bdpan.FileInfo) (string, error)

下载文件到本地 不超过 1 M的文件

func GetDirAllFiles

func GetDirAllFiles(accessToken, dir string) ([]*bdpan.FileInfo, error)

GetDirAllFiles 获取目录下的所有文件(通过轮询方式)

func GetFileByPath

func GetFileByPath(accessToken, path string) (*bdpan.FileInfo, error)

根据地址查找文件 在文件目录中循环查找是否有该名称文件

func GetFileContentMD5

func GetFileContentMD5(file *bdpan.FileInfo) (string, error)

获取文件的真实md5

func GetFileInfo

func GetFileInfo(token string, fsid uint64) (*bdpan.FileInfo, error)

func GetFileInfoView

func GetFileInfoView(f *bdpan.FileInfo, args ...any) (string, error)

func GetFileLocalPath

func GetFileLocalPath(f *bdpan.FileInfo) (string, error)

获取文件本地地址

func HasLocalFile

func HasLocalFile(f *bdpan.FileInfo) bool

func PrintFileInfo

func PrintFileInfo(f *bdpan.FileInfo, args ...any) error

func UploadFile

func UploadFile(accessToken, localFilePath, remoteFilePath string, args ...any) (*bdpan.CreateFileRes, error)

uploadFile 实现文件上传的完整流程

Types

type IsRewrite

type IsRewrite bool

type Printf

type Printf func(format string, v ...any)

Jump to

Keyboard shortcuts

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