Documentation ¶
Index ¶
- Constants
- type Addition
- type BaiduNetdisk
- func (d *BaiduNetdisk) Config() driver.Config
- func (d *BaiduNetdisk) Copy(ctx context.Context, srcObj, dstDir model.Obj) error
- func (d *BaiduNetdisk) Drop(ctx context.Context) error
- func (d *BaiduNetdisk) GetAddition() driver.Additional
- func (d *BaiduNetdisk) Init(ctx context.Context) error
- func (d *BaiduNetdisk) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (d *BaiduNetdisk) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (d *BaiduNetdisk) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)
- func (d *BaiduNetdisk) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
- func (d *BaiduNetdisk) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, ...) (model.Obj, error)
- func (d *BaiduNetdisk) PutRapid(ctx context.Context, dstDir model.Obj, stream model.FileStreamer) (model.Obj, error)
- func (d *BaiduNetdisk) Remove(ctx context.Context, obj model.Obj) error
- func (d *BaiduNetdisk) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)
- type DownloadResp
- type DownloadResp2
- type File
- type ListResp
- type PrecreateResp
- type TokenErrResp
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addition ¶
type Addition struct { RefreshToken string `json:"refresh_token" required:"true"` driver.RootPath OrderBy string `json:"order_by" type:"select" options:"name,time,size" default:"name"` OrderDirection string `json:"order_direction" type:"select" options:"asc,desc" default:"asc"` DownloadAPI string `json:"download_api" type:"select" options:"official,crack" default:"official"` ClientID string `json:"client_id" required:"true" default:"iYCeC9g08h5vuP9UqvPHKKSVrKFXGa1v"` ClientSecret string `json:"client_secret" required:"true" default:"jXiFMOPVPCWlO2M5CwWQzffpNPaGTRBG"` CustomCrackUA string `json:"custom_crack_ua" required:"true" default:"netdisk"` AccessToken string UploadThread string `json:"upload_thread" default:"3" help:"1<=thread<=32"` UploadAPI string `json:"upload_api" default:"https://d.pcs.baidu.com"` CustomUploadPartSize int64 `json:"custom_upload_part_size" type:"number" default:"0" help:"0 for auto"` }
type BaiduNetdisk ¶
func (*BaiduNetdisk) Config ¶
func (d *BaiduNetdisk) Config() driver.Config
func (*BaiduNetdisk) GetAddition ¶
func (d *BaiduNetdisk) GetAddition() driver.Additional
func (*BaiduNetdisk) Put ¶
func (d *BaiduNetdisk) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) (model.Obj, error)
Put
**注意**: 截至 2024/04/20 百度云盘 api 接口返回的时间永远是当前时间,而不是文件时间。 而实际上云盘存储的时间是文件时间,所以此处需要覆盖时间,保证缓存与云盘的数据一致
func (*BaiduNetdisk) PutRapid ¶
func (d *BaiduNetdisk) PutRapid(ctx context.Context, dstDir model.Obj, stream model.FileStreamer) (model.Obj, error)
type DownloadResp ¶
type DownloadResp2 ¶
type DownloadResp2 struct { Errno int `json:"errno"` Info []struct { //ExtentTinyint4 int `json:"extent_tinyint4"` //ExtentTinyint1 int `json:"extent_tinyint1"` //Bitmap string `json:"bitmap"` //Category int `json:"category"` //Isdir int `json:"isdir"` //Videotag int `json:"videotag"` Dlink string `json:"dlink"` } `json:"info"` RequestID int64 `json:"request_id"` }
type File ¶
type File struct { //TkbindId int `json:"tkbind_id"` //OwnerType int `json:"owner_type"` //Category int `json:"category"` //RealCategory string `json:"real_category"` FsId int64 `json:"fs_id"` //OperId int `json:"oper_id"` Thumbs struct { //Icon string `json:"icon"` Url3 string `json:"url3"` } `json:"thumbs"` Size int64 `json:"size"` //ExtentTinyint7 int `json:"extent_tinyint7"` Path string `json:"path"` //Share int `json:"share"` //Pl int `json:"pl"` ServerFilename string `json:"server_filename"` Md5 string `json:"md5"` //OwnerId int `json:"owner_id"` //Unlist int `json:"unlist"` Isdir int `json:"isdir"` // list resp ServerCtime int64 `json:"server_ctime"` ServerMtime int64 `json:"server_mtime"` LocalMtime int64 `json:"local_mtime"` LocalCtime int64 `json:"local_ctime"` // only create and precreate resp Ctime int64 `json:"ctime"` Mtime int64 `json:"mtime"` }
type PrecreateResp ¶
type TokenErrResp ¶
Click to show internal directories.
Click to hide internal directories.