api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package api 定义百度网盘SDK的接口

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizationer

type Authorizationer interface {
	AccessToken(any) error
	RefreshToken(any) error
	GetToken() string
}

Authorizationer 获取百度网盘的授权需要实现此接口

type Downloader

type Downloader interface {
	Download(downDir string, path string, downloadStatuFunc func(fms response.FileMetaResp)) (err error)
}

Downloader 文件下载

type FileLister

type FileLister interface {
	FileList(*request.FileListReq) (*response.FileListResp, error)
	FileListRecursion(*request.FileListRecursionReq) (*response.FileListResp, error)
}

FileLister 文件列表

type FileManager

type FileManager interface {
	CreateDir(dirname string, remotePath string) error
	Copy(req *request.FileManagerReq) (resp *response.FileManagerResp, err error)
	Rename(req *request.FileManagerReq) (resp *response.FileManagerResp, err error)
	Move(req *request.FileManagerReq) (resp *response.FileManagerResp, err error)
	Delete(req *request.FileManagerReq) (resp *response.FileManagerResp, err error)
}

FileManager 文件管理,这里的文件是指网盘里的文件

type FileMetaer

type FileMetaer interface {
	FileMeta(*request.FileMetaReq) (*response.FileMetasResp, error)
}

FileMetaer 文件详情

type FileSearcher

type FileSearcher interface {
	FileSearch(req *request.FileSearchReq) (*response.FileSearchResp, error)
}

FileSearcher 文件搜索

type Quotaer

type Quotaer interface {
	Quota(*request.QuotaReq) (*response.QuotaResp, error)
}

Quotaer 网盘容量

type Sdker

Sdker 集成所有的接口,这样在实例化实现了Sdker接口的结构体后,便能够直接调用所有的接口方法

type Uploader

type Uploader interface {
	Upload(...*request.UploadReq) error
}

Uploader 文件上传

type UserInfoer

type UserInfoer interface {
	UserInfo() (*response.UserInfoResp, error)
}

UserInfoer 用户信息

Jump to

Keyboard shortcuts

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