Documentation ¶
Index ¶
- Constants
- Variables
- func AesDecrypt(data, key []byte) ([]byte, error)
- func AesDecryptBase64(data, key []byte) ([]byte, error)
- func AesEncrypt(data, key []byte) ([]byte, error)
- func AesEncryptBase64(data, key []byte) ([]byte, error)
- func Bool2Int(b bool) int8
- func GetSecretKey() string
- func Int2Bool(i int8) bool
- func Md5Hex(v string) string
- func MustAesDecryptBase64Str(data, key string) string
- func MustAesEncryptBase64Str(data, key string) string
- func MustRsaEncryptBase64Str(data, key string) string
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func RsaEncrypt(data, key []byte) ([]byte, error)
- func RsaEncryptBase64(data, key []byte) ([]byte, error)
- type Bool
- type CloudCircleInfo
- type CloudCircleUser
- type CommitMultiUploadData
- type DeleteTaskData
- type DeviceInfo
- type File
- type FileInfo
- type Folder
- type FolderInfo
- type GetConflictTaskInfoData
- type GetFileDownloadUrlData
- type GetMultiUploadData
- type GetUploadedPartsInfoData
- type IconBase
- type IconOption
- type InitMultiUploadData
- type Int
- type Int64
- type Json
- type LoginResp
- type MoClient
- func (c *MoClient) AddBatchTask(task TaskParam, option ...RestyOption) (*TaskData, error)
- func (c *MoClient) CancelBatchTask(taskId string, taskType TaskType, option ...RestyOption) error
- func (c *MoClient) CheckBatchTask(task TaskCheckParam, option ...RestyOption) (*TaskStatus, error)
- func (c *MoClient) CloudCircleUserDetail(cloudId string, option ...RestyOption) (*CloudCircleInfo, error)
- func (c *MoClient) CloudCircleUserQuit(cloudId string, option ...RestyOption) error
- func (c *MoClient) CloudDiskStartBusiness() error
- func (c *MoClient) CommitMultiUploadFile(uploadFileId string, paramOption []ParamOption, option ...RestyOption) (*CommitMultiUploadData, error)
- func (c *MoClient) CreateCloudCircle(cloudName string, option ...RestyOption) (*CloudCircleInfo, error)
- func (c *MoClient) CreateFolder(folderName, parentFolderId string, paramOption []ParamOption, ...) (*Folder, error)
- func (c *MoClient) CreateFolderNotCheck(folderName, parentFolderId string, paramOption []ParamOption, ...) (*Folder, error)
- func (c *MoClient) DeleteToRecycle(file []TaskFileParam, paramOption []ParamOption, option ...RestyOption) (*DeleteTaskData, error)
- func (c *MoClient) DismissCloudCircle(cloudID string, option ...RestyOption) error
- func (c *MoClient) ForgotPassword(phone string, option ...RestyOption) (func(code, newPassword string) error, error)
- func (c *MoClient) ForgotPasswordStep2(phone, code, newPassword string, option ...RestyOption) error
- func (c *MoClient) GetAllMultiUploadUrls(uploadFileId string, partInfo []string, option ...RestyOption) ([]GetMultiUploadData, error)
- func (c *MoClient) GetCloudToken(cloudID string, option ...RestyOption) (*TokenData, error)
- func (c *MoClient) GetConflictTaskInfo(taskID string, taskType TaskType, option ...RestyOption) (*GetConflictTaskInfoData, error)
- func (c *MoClient) GetDeviceInfo() string
- func (c *MoClient) GetFileDownloadUrl(fileID string, paramOption []ParamOption, option ...RestyOption) (*GetFileDownloadUrlData, error)
- func (c *MoClient) GetFileInfo(fileId string, paramOption []ParamOption, option ...RestyOption) (*FileInfo, error)
- func (c *MoClient) GetFolderInfo(folderId string, paramOption []ParamOption, option ...RestyOption) (*FolderInfo, error)
- func (c *MoClient) GetShareFileDownloadUrl(shareId, fileId string, option ...RestyOption) (*GetFileDownloadUrlData, error)
- func (c *MoClient) GetShareInfo(accessCode string, option ...RestyOption) (*ShareInfoData, error)
- func (c *MoClient) GetUploadedPartsInfo(uploadFileId string, option ...RestyOption) (*GetUploadedPartsInfoData, error)
- func (c *MoClient) GetUserInfo(option ...RestyOption) (*UserInfo, error)
- func (c *MoClient) InitMultiUpload(ctx context.Context, file UpdloadFileParam, paramOption []ParamOption, ...) (*InitMultiUploadData, error)
- func (c *MoClient) InviteCloudCircleUser(code string, option ...RestyOption) error
- func (c *MoClient) Login(phone, password string, option ...RestyOption) (*LoginResp, error)
- func (c *MoClient) LoginBySms(phone string, option ...RestyOption) (func(code string) (*LoginResp, error), error)
- func (c *MoClient) LoginBySmsStep2(phone, smsCode string, option ...RestyOption) (*LoginResp, error)
- func (c *MoClient) Logout(option ...RestyOption) error
- func (c *MoClient) LogoutOnline(random, remoteType string, option ...RestyOption) error
- func (c *MoClient) Online(option ...RestyOption) ([]OnlineData, error)
- func (c *MoClient) QueryAllCloudCircleApp(option ...RestyOption) ([]CloudCircleInfo, error)
- func (c *MoClient) QueryFiles(folderId string, pageNum int, paramOption []ParamOption, option ...RestyOption) (*QueryFilesData, error)
- func (c *MoClient) QueryUserCloudStorage(option ...RestyOption) ([]UserCloudStorageData, error)
- func (c *MoClient) RenameFile(fileID, fileName string, paramOption []ParamOption, option ...RestyOption) (*RenameFileData, error)
- func (c *MoClient) RenameFolder(fileID, fileName string, paramOption []ParamOption, option ...RestyOption) (*RenameFolderData, error)
- func (c *MoClient) Request(url string, data Json, resp any, option ...RestyOption) ([]byte, error)
- func (c *MoClient) SearchFiles(filename, folderId string, pageNum int, paramOption []ParamOption, ...) (*SearchFileData, error)
- func (c *MoClient) SetAuthorization(authorization string) *MoClient
- func (c *MoClient) SetClient(client *http.Client) *MoClient
- func (c *MoClient) SetDeviceInfo(info string) *MoClient
- func (c *MoClient) SetOnAuthorizationExpired(f func(err error) error) *MoClient
- func (c *MoClient) SetProxy(proxy string) *MoClient
- func (c *MoClient) SetRestyClient(client *resty.Client) *MoClient
- func (c *MoClient) UsedSpace(option ...RestyOption) (*UsedSpaceData, error)
- type OnlineData
- type OrderBy
- type ParamOption
- func ParamOptionShareFile(cloudId string) ParamOption
- func QueryFileOptionFileType(fileType fileType) ParamOption
- func QueryFileOptionIconOption(icon IconOption) ParamOption
- func QueryFileOptionMediaAttr(flag bool) ParamOption
- func QueryFileOptionPageSize(size int) ParamOption
- func QueryFileOptionSort(orderBy OrderBy, desc bool) ParamOption
- func SearchFilesOptionRecursive(recursive bool) ParamOption
- func UpdloadOptionOpertype(opertype updloadOpertype) ParamOption
- func WarpParamOption(option ...ParamOption) []ParamOption
- type QueryFilesData
- type RenameFileData
- type RenameFolderData
- type Resp
- type RestyOption
- type SearchFileData
- type ShareInfoData
- type String
- type TaskBaseInfo
- type TaskCheckParam
- type TaskData
- type TaskFileParam
- type TaskParam
- type TaskStatus
- type TaskType
- type Time1
- type Time2
- type Time3
- type Time4
- type TokenData
- type UpdloadFileParam
- type UsedSpaceData
- type UserCloudStorageData
- type UserInfo
Constants ¶
const ( AllType fileType = iota FileType FolderType ImageType AudioType VideoType DocumentType )
const ( U_Rename updloadOpertype = 1 U_Overwrite updloadOpertype = 3 )
const ( HomeUrl = "https://mopan.sc.189.cn" MoPanProxyUrl = HomeUrl + "/mopanproxy" MoPanProxyUpdload = MoPanProxyUrl + "/fileupload" MoPanProxyFamily = MoPanProxyUrl + "/family" MoPanProxyAuthUrl = MoPanProxyUrl + "/auth" )
const DefaultPublicKey = `` /* 452-byte string literal not displayed */
Variables ¶
var DefaultDeviceInfo = DeviceInfo{ DeviceNo: "1104a897925070c638d", MpRemoteType: "3", MpRemoteChannel: "100", MpVersion: "1.0.3008", MpVersionCode: 145, MpDeviceSerialNum: strings.ReplaceAll(uuid.NewString(), "-", ""), MpManufcaturer: "Windows端", MpModel: "", MpOs: "Windows", MpOsVersion: "31", MpOsVersion2: "12", }
默认设备信息 根据windwos信息构建
Functions ¶
func AesDecryptBase64 ¶
AesDecryptBase64 使用 base64 解码和 ase 解密数据
func AesEncryptBase64 ¶
AesEncryptBase64 使用 ase 加密和 base64 编码数据
func GetSecretKey ¶
func GetSecretKey() string
func MustAesDecryptBase64Str ¶
MustAesDecryptBase64Str 使用 base64 解码和 ase 解密数据
func MustAesEncryptBase64Str ¶
MustAesEncryptBase64Str 使用 ase 加密和 base64 编码数据
func MustRsaEncryptBase64Str ¶
MustRsaEncryptBase64Str 使用 rsa 加密和 base64 编码数据
func NewECBDecrypter ¶
NewECBDecrypter returns a BlockMode which decrypts in electronic codebook (ECB) mode, using the given Block.
func NewECBEncrypter ¶
NewECBEncrypter returns a BlockMode which encrypts in elecronic codebook (ECB) mode, using the given Block (Cipher).
func RsaEncryptBase64 ¶
RsaEncryptBase64 使用 rsa 加密和 base64 编码数据
Types ¶
type CloudCircleInfo ¶
type CloudCircleInfo struct { AlbumFolderID string `json:"albumFolderId"` // 相册ID AlbumName string `json:"albumName"` // 相册名称 AlbumPath string `json:"albumPath"` // 相册路径 CloudCircleName string `json:"cloudCircleName"` // 空间名称 CloudID string `json:"cloudId"` // 空间ID CloudRelationID string `json:"cloudRelationId"` // 关联ID CreateUser string `json:"createUser"` // 创建用户 DynamicCoverType int `json:"dynamicCoverType"` FileFolderID string `json:"fileFolderId"` // 目录ID FileName string `json:"fileName"` // 文件名称 FilePath string `json:"filePath"` // 文件路径 IsDisturb Bool `json:"isDisturb"` // 消息免打扰 IsTop Bool `json:"isTop"` // 是否置顶 IsTv Bool `json:"isTv"` // 是否在TV上展示 Aliss string `json:"aliss"` // 用户昵称 JoinOrCreate int `json:"joinOrCreate"` // (1:creare,2:join) JoinType int `json:"joinType"` // 加入权限(1:允许任何人加入,2:管理员审核加入,3:不允许任何人加入) PublishFlag int `json:"publishFlag"` // 发布权限(1:仅限管理员,2:所有成员) MemberFlag int `json:"memberFlag"` OperationFlag int `json:"operationFlag"` PackageFlag int `json:"packageFlag"` UserList []CloudCircleUser `json:"userList"` // 用户列表 TopTime Time3 `json:"topTime,omitempty"` // 置顶操作时间 }
共享空间
type CloudCircleUser ¶
type CommitMultiUploadData ¶
type DeleteTaskData ¶
type DeleteTaskData struct { NotDeleteFileIds []string `json:"notDeleteFileIds"` TaskBaseInfo }
type DeviceInfo ¶
type DeviceInfo struct { DeviceNo string `json:"deviceNo"` //(PC:1104a897925070c638d,Android:140fe1da9fbf4b719f1) MpRemoteType string `json:"mp_remoteType"` // android:1,windows:3,mac:5 MpRemoteChannel string `json:"mp_remoteChannel"` // android:203,PC:100 MpVersion string `json:"mp_version"` // 程序版本 MpVersionCode int `json:"mp_version_code"` // 程序版本Code MpDeviceSerialNum string `json:"mp_deviceSerialNum"` // 设备编号 uuid len:32 MpManufcaturer string `json:"mp_manufcaturer"` // (Windows端,Mac端,{设备品牌}) MpModel string `json:"mp_model"` // 手机型号 MpOs string `json:"mp_os"` // (Android,Windows,macOS) MpOsVersion string `json:"mp_osVersion"` // 31 MpOsVersion2 string `json:"mp_osVersion2"` // 12 }
func (*DeviceInfo) Decrypt ¶
func (e *DeviceInfo) Decrypt(v string) error
func (*DeviceInfo) Encrypt ¶
func (e *DeviceInfo) Encrypt() string
type File ¶
type File struct { ID String `json:"id"` Name string `json:"name"` // 文件名 Size int64 `json:"size"` // 文件大小 Md5 string `json:"md5"` IconBase MediaType int `json:"mediaType"` // 媒体类型 IsCollect bool `json:"isCollect"` // 是否收藏 IsJuBao bool `json:"isJuBao"` // 被举报?? Rev Time2 `json:"rev"` // 查询时间 CreateDate Time1 `json:"createDate"` LastOpTime Time1 `json:"lastOpTime"` StarLabel int `json:"starLabel"` FileCata int `json:"fileCata"` Orientation int `json:"orientation,omitempty"` }
type FileInfo ¶
type FileInfo struct { ID String `json:"id"` // 文件ID ParentID String `json:"parentId"` // 父ID Name string `json:"name"` // 文件名 Size int64 `json:"size"` // 文件大小 Md5 string `json:"md5"` NickName string `json:"nickName"` // 用户名称 FilePath string `json:"filePath"` // 文件路径 IconBase FileDownloadURL string `json:"fileDownloadUrl"` // 下载链接 MediaType int `json:"mediaType"` // 媒体类型 IsCollect bool `json:"isCollect"` // 是否收藏 IsJuBao bool `json:"isJuBao"` // 被举报?? Rev Time2 `json:"rev"` // 查询时间 CreateDate Time1 `json:"createDate"` // 创建时间 LastOpTime Time3 `json:"lastOpTime"` // 修改时间 LastOpTimeStr Time1 `json:"lastOpTimeStr"` // 修改时间 ShootTime Time1 `json:"shootTime,omitempty"` // 拍摄时间 }
type Folder ¶
type Folder struct { ID String `json:"id"` // 文件夹ID ParentID String `json:"parentId"` // 文件夹父ID Name string `json:"name"` // 名称 FileListSize Int `json:"fileListSize"` // 列表大小 IsCollect bool `json:"isCollect"` // 是否收藏 Rev Time2 `json:"rev"` // 查询时间 CreateDate Time1 `json:"createDate"` // 创建时间 LastOpTime Time1 `json:"lastOpTime"` // 修改时间 StarLabel Int `json:"starLabel"` FileCata Int `json:"fileCata"` }
type FolderInfo ¶
type FolderInfo struct { FileID String `json:"fileId"` // 文件夹ID ParentID String `json:"parentId"` // 父ID FileName string `json:"fileName"` // 文件夹名称 FilePath string `json:"filePath"` // 文件夹路径 Rev Time2 `json:"rev"` // 查询时间 CreateTime Time3 `json:"createTime"` // 创建时间 CreateDate Time1 `json:"createDate"` // 创建时间 LastOpTime Time3 `json:"lastOpTime"` // 修改时间 LastOpTimeStr Time1 `json:"lastOpTimeStr"` // 修改时间 IsCollect bool `json:"isCollect"` // 是否收藏 }
type GetConflictTaskInfoData ¶
type GetFileDownloadUrlData ¶
type GetMultiUploadData ¶
type GetMultiUploadData struct { HTTPMethod string `json:"httpMethod"` HTTPURL string `json:"httpURL"` ContentType string `json:"contentType"` Authorization string `json:"authorization"` Date string `json:"date"` Limitrate string `json:"limitrate"` PartMD5 string `json:"partMD5"` PartNumber int `json:"partNumber"` UploadID string `json:"uploadId"` ExpireTime Time3 `json:"expireTime"` }
func (*GetMultiUploadData) Headers ¶
func (m *GetMultiUploadData) Headers() map[string]string
func (*GetMultiUploadData) NewRequest ¶
type IconBase ¶
type IconBase struct { Icon struct { SmallURL string `json:"smallUrl,omitempty"` // icon:1|3|5|7|9|11|13|15 MediumUrl string `json:"mediumUrl,omitempty"` // icon:2|3|6|7|10|11|14|15 LargeUrl string `json:"largeUrl,omitempty"` // icon:4|5|6|7|12|13|14|15 Max600 string `json:"max600,omitempty"` // icon:8|9|10|11|12|13|14|15 } `json:"icon,omitempty"` }
type IconOption ¶
type IconOption int8
const ( IconSmall IconOption = (1 << iota) IconMedium IconLarge IconMax600 )
type InitMultiUploadData ¶
type Json ¶
func ApplyParamOption ¶
func ApplyParamOption(param Json, option ...ParamOption) Json
type MoClient ¶
type MoClient struct { Authorization string DeviceInfo string Client *resty.Client // contains filtered or unexported fields }
func NewMoClient ¶
func NewMoClient() *MoClient
func (*MoClient) AddBatchTask ¶
func (c *MoClient) AddBatchTask(task TaskParam, option ...RestyOption) (*TaskData, error)
增加批量任务
func (*MoClient) CancelBatchTask ¶
func (c *MoClient) CancelBatchTask(taskId string, taskType TaskType, option ...RestyOption) error
取消批量任务
func (*MoClient) CheckBatchTask ¶
func (c *MoClient) CheckBatchTask(task TaskCheckParam, option ...RestyOption) (*TaskStatus, error)
检查批量任务状态
func (*MoClient) CloudCircleUserDetail ¶
func (c *MoClient) CloudCircleUserDetail(cloudId string, option ...RestyOption) (*CloudCircleInfo, error)
查询单个空间信息
func (*MoClient) CloudCircleUserQuit ¶
func (c *MoClient) CloudCircleUserQuit(cloudId string, option ...RestyOption) error
退出空间
func (*MoClient) CloudDiskStartBusiness ¶
宽带提速(不知道是不是真的)
func (*MoClient) CommitMultiUploadFile ¶
func (c *MoClient) CommitMultiUploadFile(uploadFileId string, paramOption []ParamOption, option ...RestyOption) (*CommitMultiUploadData, error)
提交上传文件
func (*MoClient) CreateCloudCircle ¶
func (c *MoClient) CreateCloudCircle(cloudName string, option ...RestyOption) (*CloudCircleInfo, error)
创建空间
func (*MoClient) CreateFolder ¶
func (c *MoClient) CreateFolder(folderName, parentFolderId string, paramOption []ParamOption, option ...RestyOption) (*Folder, error)
创建文件夹
func (*MoClient) CreateFolderNotCheck ¶
func (c *MoClient) CreateFolderNotCheck(folderName, parentFolderId string, paramOption []ParamOption, option ...RestyOption) (*Folder, error)
创建文件夹(不检查是否存在)
func (*MoClient) DeleteToRecycle ¶
func (c *MoClient) DeleteToRecycle(file []TaskFileParam, paramOption []ParamOption, option ...RestyOption) (*DeleteTaskData, error)
删除文件到回收站
func (*MoClient) DismissCloudCircle ¶
func (c *MoClient) DismissCloudCircle(cloudID string, option ...RestyOption) error
解散空间
func (*MoClient) ForgotPassword ¶
func (c *MoClient) ForgotPassword(phone string, option ...RestyOption) (func(code, newPassword string) error, error)
忘记密码
func (*MoClient) ForgotPasswordStep2 ¶
func (c *MoClient) ForgotPasswordStep2(phone, code, newPassword string, option ...RestyOption) error
忘记密码步骤2
func (*MoClient) GetAllMultiUploadUrls ¶
func (c *MoClient) GetAllMultiUploadUrls(uploadFileId string, partInfo []string, option ...RestyOption) ([]GetMultiUploadData, error)
获取分片上传信息
func (*MoClient) GetCloudToken ¶
func (c *MoClient) GetCloudToken(cloudID string, option ...RestyOption) (*TokenData, error)
func (*MoClient) GetConflictTaskInfo ¶
func (c *MoClient) GetConflictTaskInfo(taskID string, taskType TaskType, option ...RestyOption) (*GetConflictTaskInfoData, error)
获取任务冲突信息
func (*MoClient) GetDeviceInfo ¶
func (*MoClient) GetFileDownloadUrl ¶
func (c *MoClient) GetFileDownloadUrl(fileID string, paramOption []ParamOption, option ...RestyOption) (*GetFileDownloadUrlData, error)
获取下载链接
func (*MoClient) GetFileInfo ¶
func (c *MoClient) GetFileInfo(fileId string, paramOption []ParamOption, option ...RestyOption) (*FileInfo, error)
获取文件详细信息 可用选项 QueryFileOptionIconOption QueryFileOptionMediaAttr QueryFileOptionShareFile
func (*MoClient) GetFolderInfo ¶
func (c *MoClient) GetFolderInfo(folderId string, paramOption []ParamOption, option ...RestyOption) (*FolderInfo, error)
获取文件详细信息
func (*MoClient) GetShareFileDownloadUrl ¶
func (c *MoClient) GetShareFileDownloadUrl(shareId, fileId string, option ...RestyOption) (*GetFileDownloadUrlData, error)
func (*MoClient) GetShareInfo ¶
func (c *MoClient) GetShareInfo(accessCode string, option ...RestyOption) (*ShareInfoData, error)
func (*MoClient) GetUploadedPartsInfo ¶
func (c *MoClient) GetUploadedPartsInfo(uploadFileId string, option ...RestyOption) (*GetUploadedPartsInfoData, error)
查询分片上传情况
func (*MoClient) GetUserInfo ¶
func (c *MoClient) GetUserInfo(option ...RestyOption) (*UserInfo, error)
获取用户详细信息
func (*MoClient) InitMultiUpload ¶
func (c *MoClient) InitMultiUpload(ctx context.Context, file UpdloadFileParam, paramOption []ParamOption, option ...RestyOption) (*InitMultiUploadData, error)
初始化上传
func (*MoClient) InviteCloudCircleUser ¶
func (c *MoClient) InviteCloudCircleUser(code string, option ...RestyOption) error
加入空间
func (*MoClient) Login ¶
func (c *MoClient) Login(phone, password string, option ...RestyOption) (*LoginResp, error)
通过手机号密码登录
func (*MoClient) LoginBySms ¶
func (c *MoClient) LoginBySms(phone string, option ...RestyOption) (func(code string) (*LoginResp, error), error)
短信登陆
func (*MoClient) LoginBySmsStep2 ¶
func (c *MoClient) LoginBySmsStep2(phone, smsCode string, option ...RestyOption) (*LoginResp, error)
短信登陆步骤2
func (*MoClient) LogoutOnline ¶
func (c *MoClient) LogoutOnline(random, remoteType string, option ...RestyOption) error
登出在线设备(错误的参数可能导致当前账号登出)
func (*MoClient) Online ¶
func (c *MoClient) Online(option ...RestyOption) ([]OnlineData, error)
获取所有在线设备
func (*MoClient) QueryAllCloudCircleApp ¶
func (c *MoClient) QueryAllCloudCircleApp(option ...RestyOption) ([]CloudCircleInfo, error)
查询所有共享空间信息
func (*MoClient) QueryFiles ¶
func (c *MoClient) QueryFiles(folderId string, pageNum int, paramOption []ParamOption, option ...RestyOption) (*QueryFilesData, error)
查询文件、文件夹 当folderId == -11时列出所有文件夹
func (*MoClient) QueryUserCloudStorage ¶
func (c *MoClient) QueryUserCloudStorage(option ...RestyOption) ([]UserCloudStorageData, error)
查询所有用户空间
func (*MoClient) RenameFile ¶
func (c *MoClient) RenameFile(fileID, fileName string, paramOption []ParamOption, option ...RestyOption) (*RenameFileData, error)
重命名文件
func (*MoClient) RenameFolder ¶
func (c *MoClient) RenameFolder(fileID, fileName string, paramOption []ParamOption, option ...RestyOption) (*RenameFolderData, error)
重命名文件夹
func (*MoClient) SearchFiles ¶
func (c *MoClient) SearchFiles(filename, folderId string, pageNum int, paramOption []ParamOption, option ...RestyOption) (*SearchFileData, error)
搜索文件、文件夹
func (*MoClient) SetAuthorization ¶
func (*MoClient) SetDeviceInfo ¶
func (*MoClient) SetOnAuthorizationExpired ¶
当Token生效时回调
func (*MoClient) SetRestyClient ¶
func (*MoClient) UsedSpace ¶
func (c *MoClient) UsedSpace(option ...RestyOption) (*UsedSpaceData, error)
使用空间查询
type OnlineData ¶
type OnlineData struct { DeviceNo string `json:"deviceNo"` // 设备编号 IP string `json:"ip"` LoginAccount string `json:"loginAccount"` LoginDevice string `json:"loginDevice"` LoginOs string `json:"loginOs"` LoginPlat string `json:"loginPlat"` LoginTime Time3 `json:"loginTime"` Random string `json:"random"` UserID string `json:"userId"` Username string `json:"username"` Phone string `json:"phone"` NickName string `json:"nickName"` Authorities []any `json:"authorities"` Roles []any `json:"roles"` AccountNonExpired bool `json:"accountNonExpired"` // 帐户未过期 AccountNonLocked bool `json:"accountNonLocked"` // 帐户未锁定 CredentialsNonExpired bool `json:"credentialsNonExpired"` // 证书未过期 ExpireTime Time3 `json:"expireTime"` // 过期时间 Token string `json:"token,omitempty"` // 当前设备返回Token Enabled bool `json:"enabled"` }
type ParamOption ¶
type ParamOption func(Json)
func ParamOptionShareFile ¶
func ParamOptionShareFile(cloudId string) ParamOption
通用: 查询共享空间 如果 cloudId 为空则不做任何操作
func QueryFileOptionFileType ¶
func QueryFileOptionFileType(fileType fileType) ParamOption
func QueryFileOptionIconOption ¶
func QueryFileOptionIconOption(icon IconOption) ParamOption
返回icon方案 关闭: icon 0
func SearchFilesOptionRecursive ¶
func SearchFilesOptionRecursive(recursive bool) ParamOption
是否递归搜索
func UpdloadOptionOpertype ¶
func UpdloadOptionOpertype(opertype updloadOpertype) ParamOption
func WarpParamOption ¶
func WarpParamOption(option ...ParamOption) []ParamOption
type QueryFilesData ¶
type RenameFileData ¶
type RenameFileData struct { ID string `json:"id"` Name string `json:"name"` Md5 string `json:"md5"` Size int64 `json:"size"` FileCata int `json:"fileCata"` MediaType int `json:"mediaType"` Rev Time2 `json:"rev"` // 查询时间 CreateDate Time1 `json:"createDate"` // 创建时间 LastOpTime Time1 `json:"lastOpTime"` // 修改时间 }
type RenameFolderData ¶
type RenameFolderData struct { ID string `json:"id"` ParentID string `json:"parentId"` Name string `json:"name"` FileListSize int `json:"fileListSize"` FileCata int `json:"fileCata"` Rev Time2 `json:"rev"` // 查询时间 CreateDate Time1 `json:"createDate"` // 创建时间 LastOpTime Time1 `json:"lastOpTime"` // 修改时间 }
type Resp ¶
type Resp struct { Code int64 `json:"code"` Message string `json:"message"` Data json.RawMessage `json:"data"` Status bool `json:"status"` }
type RestyOption ¶
type RestyOption func(request *resty.Request)
type SearchFileData ¶
type ShareInfoData ¶
type ShareInfoData struct {}
type TaskBaseInfo ¶
type TaskCheckParam ¶
type TaskCheckParam struct { TaskId string `json:"taskId"` TaskType TaskType `json:"taskType"` // 操作 TargetType int `json:"targetType"` // 1 TargetFolderID string `json:"targetFolderId"` // 目标文件夹 TargetSource int `json:"targetSource"` // 目标 (1:用户,2:共享) TargetUserOrCloudID string `json:"targetUserOrCloudId"` // 目标用户ID或共享空间ID }
type TaskData ¶
type TaskData struct { TargetFolderID string `json:"targetFolderId"` TaskBaseInfo }
type TaskFileParam ¶
type TaskParam ¶
type TaskParam struct { UserOrCloudID string `json:"userOrCloudId"` // 用户ID或共享空间ID Source int `json:"source"` // (1:用户,2:共享) TaskType TaskType `json:"taskType"` // 操作 TargetUserOrCloudID string `json:"targetUserOrCloudId"` // 目标用户ID或共享空间ID TargetSource int `json:"targetSource"` // 目标 (1:用户,2:共享) TargetType int `json:"targetType"` // 1 TargetFolderID string `json:"targetFolderId"` // 目标文件夹 TaskStatusDetailDTOList []TaskFileParam `json:"taskStatusDetailDTOList"` }
type TaskStatus ¶
type TaskStatus struct { TaskID string `json:"taskId"` // 任务ID TaskStatus int `json:"taskStatus"` // 任务状态(1-4,4:完成,2:存在冲突) SubTaskCount int `json:"subTaskCount"` // 任务数量 SuccessedCount int `json:"successedCount"` // 成功数量 FailedCount int `json:"failedCount"` // 失败数量 SkipCount int `json:"skipCount"` // 跳过数量 SuccessedFileIDList []string `json:"successedFileIdList"` // 成功文件ID SuccessedFileIdMap map[string]string `json:"successedFileIdMap,omitempty"` // only copy }
批量任务信息
type Time4 ¶
func (*Time4) UnmarshalJSON ¶
type UpdloadFileParam ¶
type UpdloadFileParam struct { ParentFolderId string FileName string FileSize int64 File io.ReadSeeker }
type UsedSpaceData ¶
type UserCloudStorageData ¶
type UserCloudStorageData struct { ID string `json:"id"` // 数据库ID FolderID string `json:"folderId"` // 目录ID Name string `json:"name"` // 名称 CatalogueType int `json:"catalogueType"` // 分类 (1:文件|私密空间,2:相册,4:视频,5:音频,6:文档,9:同步盘) CloudType int `json:"cloudType"` // (1:普通文件,2:私密空间) FileOrAlbum int `json:"fileOrAlbum"` // 文件或相册(1:文件,2:相册) Path string `json:"path"` // 路径 UserID string `json:"userId"` // 用户ID CreateTime string `json:"createTime"` // 创建时间 UpdateTime string `json:"updateTime"` // 更新时间 IsDel Bool `json:"isDel"` // 软删除 }
type UserInfo ¶
type UserInfo struct { UserID string `json:"userId"` // 用户ID KickName string `json:"kickName"` // 昵称 Name string `json:"name"` // 手机号(省略) Phone string `json:"phone"` // 手机号(完整) RemoteChannel string `json:"remoteChannel"` // 与 DeviceInfo 相同 IsTag Bool `json:"isTag"` Isp Bool `json:"isp"` Status int `json:"status"` Version int `json:"version"` ArrearsFlag Bool `json:"arrearsFlag"` // 欠费标识 FreezeFlag int `json:"freezeFlag"` // 冻结标识 PackageFlag int `json:"packageFlag"` PrimaryFlag int `json:"primaryFlag"` VipFlag int `json:"vipFlag"` // vip标识 VirtualFlag int `json:"virtualFlag"` CreateTime string `json:"createTime"` // 创建时间 UpdateTime string `json:"updateTime"` // 更新时间 IsDel Bool `json:"isDel"` // 软删除 }
用户详细信息