request

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: 2 Imported by: 0

Documentation

Overview

Package request 所有网盘接口入参的定义

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aes

type Aes struct {
	Key []byte
	Iv  [aes.BlockSize]byte
}

type FileListRecursionReq

type FileListRecursionReq struct {
	//需要list的目录,以/开头的绝对路径, 默认为/路径包含中文时需要UrlEncode编码给出的示例的路径是/测试目录的UrlEncode编码
	Path string
	/*
		排序字段:默认为name;
			time表示先按文件类型排序,后按修改时间排序;
			name表示先按文件类型排序,后按文件名称排序;
			size表示先按文件类型排序,后按文件大小排序。
	*/
	Order string
	Desc  string //  默认为升序,设置为1实现降序 (注:排序的对象是当前目录下所有文件,不是当前分页下的文件)
	Start string //  起始位置,从0开始
	Limit string //    查询数目,默认为1000,建议最大不超过1000
	Web   string // 值为1时,返回dir_empty属性和缩略图数据
}

type FileListReq

type FileListReq struct {
	//需要list的目录,以/开头的绝对路径, 默认为/路径包含中文时需要UrlEncode编码给出的示例的路径是/测试目录的UrlEncode编码
	Dir string
	/*
		排序字段:默认为name;
			time表示先按文件类型排序,后按修改时间排序;
			name表示先按文件类型排序,后按文件名称排序;
			size表示先按文件类型排序,后按文件大小排序。
	*/
	Order     string
	Desc      string //  默认为升序,设置为1实现降序 (注:排序的对象是当前目录下所有文件,不是当前分页下的文件)
	Start     string //  起始位置,从0开始
	Limit     string //    查询数目,默认为1000,建议最大不超过1000
	Web       string // 值为1时,返回dir_empty属性和缩略图数据
	Folder    string //  是否只返回文件夹,0 返回所有,1 只返回文件夹,且属性只返回path字段
	Showempty string //   是否返回dir_empty属性,0 不返回,1 返回
}

type FileManagerInfo

type FileManagerInfo struct {
	Path    string `json:"path,omitempty"`
	Dest    string `json:"dest,omitempty"`
	Newname string `json:"newname,omitempty"`
	Ondup   string `json:"ondup,omitempty"`
}

type FileManagerReq

type FileManagerReq struct {
	Async    string            `json:"async,omitempty"`
	Filelist []FileManagerInfo `json:"filelist,omitempty"`
	Ondup    string            `json:"ondup,omitempty"`
}

type FileMetaReq

type FileMetaReq struct {
	Fsids     []int64 //	[414244021542671,633507813519281]	文件id数组,数组中元素是uint64类型,数组大小上限是:100
	Dlink     string  //			是否需要下载地址,0为否,1为是,默认为0。获取到dlink后,参考下载文档进行下载操作
	Path      string  //	/123-571234	URL参数	查询共享目录或专属空间内文件时需要。 共享目录格式: /uk-fsid  其中uk为共享目录创建者id, fsid对应共享目录的fsid 专属空间格式:/_pcs_.appdata/xpan/
	Thumb     string  //		是否需要缩略图地址,0为否,1为是,默认为0
	Extra     string  //		图片是否需要拍摄时间、原图分辨率等其他信息,0 否、1 是,默认0
	Needmedia string  //	视频是否需要展示时长信息,0 否、1 是,默认0
}

type FileSearchReq

type FileSearchReq struct {
	Key       string `json:"key"`       //	搜索关键字
	Dir       string `json:"dir"`       //	搜索目录,默认根目录
	Page      string `json:"page"`      //	页数,从1开始,缺省则返回所有条目
	Num       string `json:"num"`       //	默认为500,不能修改
	Recursion string `json:"recursion"` //	是否递归搜索子目录 1:是,0:否(默认)
	Web       string `json:"web"`       //	默认0,为1时返回缩略图信息
}

type ImplicitGrantReq

type ImplicitGrantReq struct {
	ClientId string //  M    您应用的AppKey。
	Display  string //  O    授权页面展示方式。参见授权展示方式。

}

ImplicitGrantReq 简化模式获取授权码

type OauthDeviceCodeReq

type OauthDeviceCodeReq struct {
	ClientId     string //您应用的AppKey。
	ClientSecret string //您应用的SecretKey
	//根据授权模式来引导用户授权
	AuthMethod func(resp *response.OauthDeviceCodeResp)
}

type QuotaReq

type QuotaReq struct {
	//	是否检查免费信息,0为不查,1为查,默认为0
	Checkfree string `json:"checkfree"`
	//		是否检查过期信息,0为不查,1为查,默认为0
	Checkexpire string `json:"checkexpire"`
}

type SliceFileInfo

type SliceFileInfo struct {
	SliceName     string
	FileName      string
	Size          int64
	MD5           string
	SliceFilePath string
	ID            int64
}

type UploadReq

type UploadReq struct {
	//	需要上传到的网盘路径	RequestBody参数	上传后使用路径(不包含文件名或新的目录),需要urlencode
	//例如需要上传 c:/desktop/a.txt 到网盘/apps/novel目录下,那么:
	//  SrcPath=c:/desktop/a.txt RemotePath=/apps/novel
	RemotePath string
	SrcPath    string //本地文件的路径
	BlockSize  int64

	//	4096	RequestBody参数	文件和目录两种情况:上传文件时,表示文件的大小,单位B;上传目录时,表示目录的大小,目录的话大小默认为0
	Size int64
	//	0	RequestBody参数	是否为目录,0 文件,1 目录
	Isdir string
	/*
		["98d02a0f54781a93e354b1fc85caf488", "ca5273571daefb8ea01a42bfa5d02220"]
		RequestBody参数
		文件各分片MD5数组的json串。block_list的含义如下,如果上传的文件小于4MB,其md5值(32位小写)即为block_list字符串数组的唯一元素;
		如果上传的文件大于4MB,需要将上传的文件按照4MB大小在本地切分成分片,
		不足4MB的分片自动成为最后一个分片,所有分片的md5值(32位小写)组成的字符串数组即为block_list。
	*/
	BlockList string
	//	1	RequestBody参数	固定值1
	Autoinit string
	//	1	RequestBody参数	文件命名策略。
	/*
		1 表示当path冲突时,进行重命名
		2 表示当path冲突且block_list不同时,进行重命名
		3 当云端存在同名文件时,对该文件进行覆盖
	*/
	Rtype string

	//    P1-MTAuMjI4LjQzLjMxOjE1OTU4NTg==    RequestBody参数    上传ID
	Uploadid string
	//	content-md5  b20f8ac80063505f264e5f6fc187e69a    RequestBody参数    文件MD5,32位小写
	ContentMd5 string
	// 9aa0aa691s5c0257c5ab04dd7eddaa47    RequestBody参数    文件校验段的MD5,32位小写,校验段对应文件前256KB
	SliceMd5 string
	//1595919297    RequestBody参数    客户端创建时间, 默认为当前时间戳
	LocalCtime string
	// 1595919297    RequestBody参数    客户端修改时间,默认为当前时间戳
	LocalMtime string
	//切片上传回调,总共有多少个切片,完成了多少个,当前切片信息
	SliceUploadFunc func(countNum int, finishNum int, s SliceFileInfo)
	//文件进行Aes加密
	Aes *Aes
}

Jump to

Keyboard shortcuts

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