api

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderByName OrderType = "name"
	OrderByTime OrderType = "time"
	OrderBySize OrderType = "size"

	CopyOperate   Operate = "copy"
	MoveOperate   Operate = "move"
	RenameOperate Operate = "rename"
	DeleteOperate Operate = "delete"
)

Variables

This section is empty.

Functions

func BodyList

func BodyList(slice []string) string

func BoolToInt

func BoolToInt(b bool) int

func BoolToStr

func BoolToStr(b bool) string

func EncryptMd5

func EncryptMd5(e string) string

func FixToBaiduPath

func FixToBaiduPath(rclonePath string) string

fixToBaiduPath baidu path need to begin with "/" and use "/" to split

func FixToBaiduPathList

func FixToBaiduPathList(rclonePath []string) []string

Types

type BaiduApi

type BaiduApi struct {
}

func (*BaiduApi) Create

func (b *BaiduApi) Create(path string, preCreateFileData *PreCreateFileData, uploadId string) (opts *rest.Opts, err error)

上传

func (*BaiduApi) CreateDir

func (b *BaiduApi) CreateDir(path string, isdir bool) (opts *rest.Opts, err error)

func (*BaiduApi) DeleteDirsOrFiles

func (b *BaiduApi) DeleteDirsOrFiles(fileList []string, async int) (opts *rest.Opts, err error)

func (*BaiduApi) DownFileDisguiseBaiduClient

func (b *BaiduApi) DownFileDisguiseBaiduClient(dLink string) (opts *rest.Opts, err error)

Disguise as a Baidu client.can down all file but will be limit speed.

func (*BaiduApi) GetFileMetas

func (b *BaiduApi) GetFileMetas(path []string, dlink bool, text bool) (opts *rest.Opts, err error)

func (*BaiduApi) GetLocateDownloadUrl

func (b *BaiduApi) GetLocateDownloadUrl(path string) (opts *rest.Opts, err error)

Disguise as a Baidu client.can down all file but will be limit speed.

func (*BaiduApi) GetTemplateVariable

func (b *BaiduApi) GetTemplateVariable() (opts *rest.Opts, err error)

func (*BaiduApi) ListDirFiles

func (b *BaiduApi) ListDirFiles(dir string, order OrderType, desc bool, showEmpty bool, page int, num int) (opts *rest.Opts, err error)

ListDirFiles order default time , desc default true ,showEmpty default false ,page begin from 1,num default 100

func (*BaiduApi) MoveOrCopyDirsOrFiles

func (b *BaiduApi) MoveOrCopyDirsOrFiles(fileList []FileManagerParam, async int, operate Operate) (opts *rest.Opts, err error)

MoveOrCopyDirsOrFiles Moving does not modify the fsid while copying generates a new fsid

func (*BaiduApi) Precreate

func (b *BaiduApi) Precreate(path string, rapidOffsetData *RapidOffsetData, preCreateFileData *PreCreateFileData) (opts *rest.Opts, err error)

上传

func (*BaiduApi) RenameDirsOrFiles

func (b *BaiduApi) RenameDirsOrFiles(fileList []FileManagerParam, async int) (opts *rest.Opts, err error)

func (*BaiduApi) Superfile2

func (b *BaiduApi) Superfile2(path string, uploadId string, partseq int, realChunkSize int64, chunk io.Reader, options ...fs.OpenOption) (opts *rest.Opts, err error)

type BaiduResponse

type BaiduResponse struct {
	BaseBaiduResponse
	GuidInf string `json:"guid_inf"`
	Guid    int64  `json:"guid"`
}

type BaseBaiduResponse

type BaseBaiduResponse struct {
	Errno     int   `json:"errno"`
	RequestId int64 `json:"request_id"`
}

func (BaseBaiduResponse) GetErrno

func (b BaseBaiduResponse) GetErrno() int

type BaseItem

type BaseItem struct {
	Ctime    int64  `json:"ctime"`
	FromType int    `json:"from_type"`
	FsId     int64  `json:"fs_id"`
	Isdir    int    `json:"isdir"`
	Md5      string `json:"md5"`
	Mtime    int64  `json:"mtime"`
	Path     string `json:"path"`
	Size     int64  `json:"size"`
	Name     string `json:"name"`
	Category int    `json:"category"`
}

type CreateVO

type CreateVO struct {
	BaseBaiduResponse
	BaseItem
}

type FileManagerParam

type FileManagerParam struct {
	Path    string `json:"path,omitempty"`
	NewName string `json:"newname,omitempty"`
	Dest    string `json:"dest,omitempty"`
	Ondup   string `json:"ondup,omitempty"` //全局ondup,遇到重复文件的处理策略, fail(默认,直接返回失败)、newcopy(重命名文件)、overwrite(原来的文件夹内容会消失)、skip
}

type FragmentVO

type FragmentVO struct {
	Md5       string `json:"md5"`
	Partseq   string `json:"partseq"`
	RequestId int64  `json:"request_id"`
	UploadId  int32  `json:"uploadid"`
}

func (FragmentVO) GetErrno

func (b FragmentVO) GetErrno() int

type InfoResponse

type InfoResponse struct {
	BaiduResponse
	Info []*Item `json:"info"`
}

type Item

type Item struct {
	ExtentTinyint7 int    `json:"extent_tinyint7"`
	ExtentTinyint4 int    `json:"extent_tinyint4"`
	ExtentTinyint3 int64  `json:"extent_tinyint3"`
	ExtentTinyint2 int    `json:"extent_tinyint2"`
	ExtentTinyint1 int    `json:"extent_tinyint1"`
	Category       int    `json:"category"`
	IsDir          int    `json:"isdir"`
	Videotag       int    `json:"videotag"`
	Dlink          string `json:"dlink"`
	OperID         int64  `json:"oper_id"`
	PathMd5        int    `json:"path_md5"`
	WpFile         int    `json:"wpfile"`
	LocalMtime     int64  `json:"local_mtime"`
	Share          int    `json:"share"`
	FileKey        string `json:"file_key"`
	Errno          int    `json:"errno"`
	// 本地文件创建时间
	LocalCtime    int64  `json:"local_ctime"`
	OwnerType     int    `json:"owner_type"`
	Privacy       int    `json:"privacy"`
	RealCategory  string `json:"real_category"`
	Picdocpreview string `json:"picdocpreview"`
	Thumbs        struct {
		Url3 string `json:"url3"`
		Url2 string `json:"url2"`
		Url1 string `json:"url1"`
		Icon string `json:"icon"`
	} `json:"thumbs"`
	Docpreview string `json:"docpreview"`
	// 服务器文件创建时间
	ServerCtime    int64  `json:"server_ctime"`
	Lodocpreview   string `json:"lodocpreview"`
	OwnerID        int    `json:"owner_id"`
	TkbindID       int    `json:"tkbind_id"`
	Size           int64  `json:"size"`
	FsID           int64  `json:"fs_id"`
	Md5            string `json:"md5"`
	ExtentInt3     int64  `json:"extent_int3"`
	Path           string `json:"path"`
	FromType       int    `json:"from_type"`
	ServerFilename string `json:"server_filename"`
	// 服务器文件修改时间,包括重命名
	ServerMtime int64 `json:"server_mtime"`
	Pl          int   `json:"pl"`

	DirEmpty    int `json:"dir_empty"`
	Empty       int `json:"empty"`
	ServerAtime int `json:"server_atime"`
	Unlist      int `json:"unlist"`
}

type ListResponse

type ListResponse struct {
	BaiduResponse
	List []*Item `json:"list"`
}

type LocateDownloadVO

type LocateDownloadVO struct {
	ClientIP string `json:"client_ip"`
	URLs     []struct {
		URL  string `json:"url"`
		Rank int    `json:"rank"`
	} `json:"urls"`
	BakURLs   string `json:"bakurls"`
	RankParam struct {
		MaxContinuousFailure int `json:"max_continuous_failure"`
		BakRankSliceNum      int `json:"bak_rank_slice_num"`
	} `json:"rank_param"`
	FSL        int   `json:"fsl"`
	MaxTimeout int   `json:"max_timeout"`
	MinTimeout int   `json:"min_timeout"`
	IV         int   `json:"iv"`
	RequestID  int64 `json:"request_id"`
}

type Operate

type Operate string

type OrderType

type OrderType string

type PreCreateFileData

type PreCreateFileData struct {
	Size       int64    `schema:"size"`
	BlockList  []string `schema:"-"`
	ContentMd5 string   `schema:"content-md5"`
	SliceMd5   string   `schema:"slice-md5"`
	LocalCtime int64    `schema:"local_ctime"`
	LocalMtime int64    `schema:"local_mtime"`
}

type PreCreateVO

type PreCreateVO struct {
	BaseBaiduResponse
	Path       string           `json:"path"` //return_type为1时 才会有这一项
	ReturnType int              `json:"return_type"`
	BlockList  []fs.StringValue `json:"block_list"` //return_type为1时 才会有这一项
	Info       *BaseItem        `json:"info"`       //return_type为2时 才会有这一项
	UploadId   string           `json:"uploadid"`   //return_type为1时 才会有这一项
}

type RapidOffsetData

type RapidOffsetData struct {
	DataTime int64 `schema:"data_time,omitempty"`
	//DataLength  int    `schema:"data_length,omitempty"`
	DataOffset  int64  `schema:"data_offset,omitempty"`
	DataContent string `schema:"data_content,omitempty"`
}

type TemplateInfo

type TemplateInfo struct {
	Bdstoken   string `json:"bdstoken"`
	Token      string `json:"token"`
	Uk         int64  `json:"uk"`
	IsDocuser  int32  `json:"isdocuser"`
	ServerTime int64  `json:"servertime"`
}

type TemplateResponse

type TemplateResponse struct {
	BaiduResponse
	Result *TemplateInfo `json:"result"`
}

Jump to

Keyboard shortcuts

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