Documentation ¶
Overview ¶
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
Index ¶
- Constants
- func IsTokenExpired(err error) bool
- type AliyunDrive
- type AuthService
- type ClientOptionFunc
- type CreateFolderReq
- type CreateFolderResp
- type DefaultLogger
- type DeleteFileReq
- type DeleteFileResp
- type DownloadFileConflictType
- type DownloadFileReq
- type File
- type FileService
- func (r *FileService) CreateFolder(ctx context.Context, request *CreateFolderReq) (*CreateFolderResp, error)
- func (r *FileService) DeleteFile(ctx context.Context, request *DeleteFileReq) (*DeleteFileResp, error)
- func (r *FileService) DownloadFile(ctx context.Context, request *DownloadFileReq) error
- func (r *FileService) DownloadFileStream(ctx context.Context, driveID, fileID string) (io.ReadCloser, error)
- func (r *FileService) GetFile(ctx context.Context, request *GetFileReq) (*GetFileResp, error)
- func (r *FileService) GetFileDownloadURL(ctx context.Context, request *GetFileDownloadURLReq) (*GetFileDownloadURLResp, error)
- func (r *FileService) GetFileList(ctx context.Context, request *GetFileListReq) (*GetFileListResp, error)
- func (r *FileService) GetFilePath(ctx context.Context, request *GetFilePathReq) (*GetFilePathResp, error)
- func (r *FileService) GetSBox(ctx context.Context) (*GetSBoxResp, error)
- func (r *FileService) MoveFile(ctx context.Context, request *MoveFileReq) (*MoveFileResp, error)
- func (r *FileService) RenameFile(ctx context.Context, request *RenameFileReq) (*RenameFileResp, error)
- func (r *FileService) SearchFile(ctx context.Context, request *SearchFileReq) (*GetFileListResp, error)
- func (r *FileService) UploadFile(ctx context.Context, request *UploadFileReq) (*UploadFileResp, error)
- func (r *FileService) UploadStream(ctx context.Context, driveID, parentID, name string, stream io.Reader, ...) (*UploadFileResp, error)
- type FileStore
- type FileType
- type GetFileDownloadURLReq
- type GetFileDownloadURLResp
- type GetFileListReq
- type GetFileListResp
- type GetFilePathReq
- type GetFilePathResp
- type GetFileReq
- type GetFileResp
- type GetSBoxResp
- type GetSelfUserResp
- type GetShareByAnonymousReq
- type GetShareByAnonymousResp
- type LogLevel
- type Logger
- type LoggerStdout
- type LoginByQrcodeReq
- type LoginQrCode
- type LoginQrTerminal
- func (*LoginQrTerminal) Close()
- func (*LoginQrTerminal) EventCanceled(res *queryQrCodeResp)
- func (*LoginQrTerminal) EventConfirmed(res *queryQrCodeResp)
- func (*LoginQrTerminal) EventExpired(res *queryQrCodeResp)
- func (*LoginQrTerminal) EventNew(res *queryQrCodeResp)
- func (t *LoginQrTerminal) EventScanned(res *queryQrCodeResp)
- func (*LoginQrTerminal) Show(content string)
- type LoginSmallQrCode
- func (s *LoginSmallQrCode) Close()
- func (s *LoginSmallQrCode) EventCanceled(res *queryQrCodeResp)
- func (s *LoginSmallQrCode) EventConfirmed(res *queryQrCodeResp)
- func (s *LoginSmallQrCode) EventExpired(res *queryQrCodeResp)
- func (s *LoginSmallQrCode) EventNew(res *queryQrCodeResp)
- func (s *LoginSmallQrCode) EventScanned(res *queryQrCodeResp)
- func (s *LoginSmallQrCode) Show(content string)
- type LoginUIQrCode
- func (u *LoginUIQrCode) Close()
- func (u *LoginUIQrCode) EventCanceled(res *queryQrCodeResp)
- func (u *LoginUIQrCode) EventConfirmed(res *queryQrCodeResp)
- func (u *LoginUIQrCode) EventExpired(res *queryQrCodeResp)
- func (*LoginUIQrCode) EventNew(res *queryQrCodeResp)
- func (u *LoginUIQrCode) EventScanned(res *queryQrCodeResp)
- func (u *LoginUIQrCode) Show(content string)
- type MoveFileReq
- type MoveFileResp
- type RawRequestReq
- type RefreshTokenReq
- type RefreshTokenResp
- type RenameFileReq
- type RenameFileResp
- type Response
- type SearchFileReq
- type ShareLinkService
- type Store
- type Token
- type UploadFileReq
- type UploadFileResp
Constants ¶
View Source
const RootFileID = "root"
Variables ¶
This section is empty.
Functions ¶
func IsTokenExpired ¶
Types ¶
type AliyunDrive ¶
type AliyunDrive struct { // service Auth *AuthService File *FileService // contains filtered or unexported fields }
func New ¶
func New(options ...ClientOptionFunc) *AliyunDrive
func (*AliyunDrive) RawRequest ¶
func (r *AliyunDrive) RawRequest(ctx context.Context, req *RawRequestReq, resp interface{}) (*Response, error)
type AuthService ¶
type AuthService struct {
// contains filtered or unexported fields
}
func (*AuthService) GetSelfUser ¶
func (r *AuthService) GetSelfUser(ctx context.Context) (*GetSelfUserResp, error)
func (*AuthService) LoginByQrcode ¶
func (r *AuthService) LoginByQrcode(ctx context.Context, request LoginQrCode) (*GetSelfUserResp, error)
func (*AuthService) RefreshToken ¶
func (r *AuthService) RefreshToken(ctx context.Context, request *RefreshTokenReq) (*RefreshTokenResp, error)
type ClientOptionFunc ¶
type ClientOptionFunc func(*AliyunDrive)
func WithLogger ¶
func WithLogger(logger Logger, level LogLevel) ClientOptionFunc
func WithStore ¶
func WithStore(store Store) ClientOptionFunc
func WithWorkDir ¶
func WithWorkDir(dir string) ClientOptionFunc
type CreateFolderReq ¶
type CreateFolderResp ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
type DeleteFileReq ¶
type DeleteFileResp ¶
type DownloadFileConflictType ¶
type DownloadFileConflictType int
const ( DownloadFileConflictTypeAutoRename DownloadFileConflictType = 0 DownloadFileConflictTypeOverwrite DownloadFileConflictType = 1 DownloadFileConflictTypeError DownloadFileConflictType = 2 )
type DownloadFileReq ¶
type DownloadFileReq struct { DriveID string `json:"drive_id"` FileID string `json:"file_id"` Dist string `json:"dist"` // 如果此值不为空,则下载文件到这个位置 DistDir string `json:"dist_dir"` // 如果此值不为空,则下载文件到 `DistDir`/<name> 位置 ConflictType DownloadFileConflictType `json:"conflict_type"` // 如果目标文件已存在,处理方式:报错,覆盖,自动重命名,默认是自动重命名 ShowProgressBar bool `json:"show_progress_bar"` // 展示下载进度条 }
type File ¶
type File struct { DriveID string `json:"drive_id"` DomainID string `json:"domain_id"` FileID string `json:"file_id"` Name string `json:"name"` Type string `json:"type"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Hidden bool `json:"hidden"` Starred bool `json:"starred"` Status string `json:"status"` UserMeta string `json:"user_meta,omitempty"` ParentFileID string `json:"parent_file_id"` EncryptMode string `json:"encrypt_mode"` ContentType string `json:"content_type,omitempty"` FileExtension string `json:"file_extension,omitempty"` MimeType string `json:"mime_type,omitempty"` MimeExtension string `json:"mime_extension,omitempty"` Size int64 `json:"size,omitempty"` Crc64Hash string `json:"crc64_hash,omitempty"` ContentHash string `json:"content_hash,omitempty"` ContentHashName string `json:"content_hash_name,omitempty"` DownloadURL string `json:"download_url,omitempty"` URL string `json:"url,omitempty"` Thumbnail string `json:"thumbnail,omitempty"` Category string `json:"category,omitempty"` PunishFlag int `json:"punish_flag,omitempty"` }
type FileService ¶
type FileService struct {
// contains filtered or unexported fields
}
func (*FileService) CreateFolder ¶
func (r *FileService) CreateFolder(ctx context.Context, request *CreateFolderReq) (*CreateFolderResp, error)
CreateFolder 创建文件夹
func (*FileService) DeleteFile ¶
func (r *FileService) DeleteFile(ctx context.Context, request *DeleteFileReq) (*DeleteFileResp, error)
DeleteFile 删除文件
func (*FileService) DownloadFile ¶
func (r *FileService) DownloadFile(ctx context.Context, request *DownloadFileReq) error
GetFile 获取文件信息
func (*FileService) DownloadFileStream ¶
func (r *FileService) DownloadFileStream(ctx context.Context, driveID, fileID string) (io.ReadCloser, error)
DownloadFileStream 获取文件流
func (*FileService) GetFile ¶
func (r *FileService) GetFile(ctx context.Context, request *GetFileReq) (*GetFileResp, error)
GetFile 获取文件信息
func (*FileService) GetFileDownloadURL ¶
func (r *FileService) GetFileDownloadURL(ctx context.Context, request *GetFileDownloadURLReq) (*GetFileDownloadURLResp, error)
GetFile 获取文件信息
func (*FileService) GetFileList ¶
func (r *FileService) GetFileList(ctx context.Context, request *GetFileListReq) (*GetFileListResp, error)
func (*FileService) GetFilePath ¶
func (r *FileService) GetFilePath(ctx context.Context, request *GetFilePathReq) (*GetFilePathResp, error)
GetFilePath 重命名
func (*FileService) GetSBox ¶
func (r *FileService) GetSBox(ctx context.Context) (*GetSBoxResp, error)
func (*FileService) MoveFile ¶
func (r *FileService) MoveFile(ctx context.Context, request *MoveFileReq) (*MoveFileResp, error)
RenameFile 重命名
func (*FileService) RenameFile ¶
func (r *FileService) RenameFile(ctx context.Context, request *RenameFileReq) (*RenameFileResp, error)
RenameFile 重命名
func (*FileService) SearchFile ¶
func (r *FileService) SearchFile(ctx context.Context, request *SearchFileReq) (*GetFileListResp, error)
GetFile 获取文件信息
func (*FileService) UploadFile ¶
func (r *FileService) UploadFile(ctx context.Context, request *UploadFileReq) (*UploadFileResp, error)
func (*FileService) UploadStream ¶
func (r *FileService) UploadStream(ctx context.Context, driveID, parentID, name string, stream io.Reader, streamSize int64, checkNameMode string) (*UploadFileResp, error)
UploadStream 从流上传文件
type GetFileDownloadURLReq ¶
type GetFileDownloadURLResp ¶
type GetFileDownloadURLResp struct { Method string `json:"method"` URL string `json:"url"` InternalURL string `json:"internal_url"` CdnURL string `json:"cdn_url"` Expiration time.Time `json:"expiration"` Size int `json:"size"` RateLimit struct { PartSpeed int `json:"part_speed"` PartSize int `json:"part_size"` } `json:"ratelimit"` }
type GetFileListReq ¶
type GetFileListReq struct { GetAll bool `json:"get_all"` DriveID string `json:"drive_id"` // drive_id 和 share_id 必选传其中一个 ParentFileID string `json:"parent_file_id"` Marker string `json:"marker"` Limit int `json:"limit"` All bool `json:"all"` URLExpireSec int `json:"url_expire_sec"` ImageThumbnailProcess string `json:"image_thumbnail_process"` ImageURLProcess string `json:"image_url_process"` VideoThumbnailProcess string `json:"video_thumbnail_process"` Fields string `json:"fields"` OrderBy string `json:"order_by"` OrderDirection string `json:"order_direction"` }
type GetFileListResp ¶
type GetFilePathReq ¶
type GetFilePathResp ¶
type GetFilePathResp struct {
Items []*File `json:"items"`
}
type GetFileReq ¶
type GetFileResp ¶
type GetSBoxResp ¶
type GetSBoxResp struct { DriveID string `json:"drive_id"` SboxUsedSize int `json:"sbox_used_size"` SboxRealUsedSize int `json:"sbox_real_used_size"` SboxTotalSize int64 `json:"sbox_total_size"` RecommendVip string `json:"recommend_vip"` PinSetup bool `json:"pin_setup"` Locked bool `json:"locked"` InsuranceEnabled bool `json:"insurance_enabled"` }
type GetSelfUserResp ¶
type GetSelfUserResp struct { DomainID string `json:"domain_id"` UserID string `json:"user_id"` Avatar string `json:"avatar"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` Email string `json:"email"` NickName string `json:"nick_name"` Phone string `json:"phone"` Role string `json:"role"` Status string `json:"status"` UserName string `json:"user_name"` Description string `json:"description"` DefaultDriveID string `json:"default_drive_id"` DenyChangePasswordBySelf bool `json:"deny_change_password_by_self"` NeedChangePasswordNextLogin bool `json:"need_change_password_next_login"` Permission interface{} `json:"permission"` }
type GetShareByAnonymousReq ¶
type GetShareByAnonymousReq struct {
}type GetShareByAnonymousResp ¶
type Logger ¶
func NewLoggerStdout ¶
func NewLoggerStdout() Logger
type LoggerStdout ¶
type LoggerStdout struct{}
type LoginByQrcodeReq ¶
type LoginQrCode ¶
type LoginQrCode interface { Show(content string) Close() EventNew(res *queryQrCodeResp) EventScanned(res *queryQrCodeResp) EventExpired(res *queryQrCodeResp) EventCanceled(res *queryQrCodeResp) EventConfirmed(res *queryQrCodeResp) }
type LoginQrTerminal ¶
type LoginQrTerminal struct {
// contains filtered or unexported fields
}
func (*LoginQrTerminal) Close ¶
func (*LoginQrTerminal) Close()
func (*LoginQrTerminal) EventCanceled ¶
func (*LoginQrTerminal) EventCanceled(res *queryQrCodeResp)
func (*LoginQrTerminal) EventConfirmed ¶
func (*LoginQrTerminal) EventConfirmed(res *queryQrCodeResp)
func (*LoginQrTerminal) EventExpired ¶
func (*LoginQrTerminal) EventExpired(res *queryQrCodeResp)
func (*LoginQrTerminal) EventNew ¶
func (*LoginQrTerminal) EventNew(res *queryQrCodeResp)
func (*LoginQrTerminal) EventScanned ¶
func (t *LoginQrTerminal) EventScanned(res *queryQrCodeResp)
func (*LoginQrTerminal) Show ¶
func (*LoginQrTerminal) Show(content string)
type LoginSmallQrCode ¶
type LoginSmallQrCode struct {
// contains filtered or unexported fields
}
func (*LoginSmallQrCode) Close ¶
func (s *LoginSmallQrCode) Close()
func (*LoginSmallQrCode) EventCanceled ¶
func (s *LoginSmallQrCode) EventCanceled(res *queryQrCodeResp)
func (*LoginSmallQrCode) EventConfirmed ¶
func (s *LoginSmallQrCode) EventConfirmed(res *queryQrCodeResp)
func (*LoginSmallQrCode) EventExpired ¶
func (s *LoginSmallQrCode) EventExpired(res *queryQrCodeResp)
func (*LoginSmallQrCode) EventNew ¶
func (s *LoginSmallQrCode) EventNew(res *queryQrCodeResp)
func (*LoginSmallQrCode) EventScanned ¶
func (s *LoginSmallQrCode) EventScanned(res *queryQrCodeResp)
func (*LoginSmallQrCode) Show ¶
func (s *LoginSmallQrCode) Show(content string)
type LoginUIQrCode ¶
type LoginUIQrCode struct {
// contains filtered or unexported fields
}
func (*LoginUIQrCode) Close ¶
func (u *LoginUIQrCode) Close()
func (*LoginUIQrCode) EventCanceled ¶
func (u *LoginUIQrCode) EventCanceled(res *queryQrCodeResp)
func (*LoginUIQrCode) EventConfirmed ¶
func (u *LoginUIQrCode) EventConfirmed(res *queryQrCodeResp)
func (*LoginUIQrCode) EventExpired ¶
func (u *LoginUIQrCode) EventExpired(res *queryQrCodeResp)
func (*LoginUIQrCode) EventNew ¶
func (*LoginUIQrCode) EventNew(res *queryQrCodeResp)
func (*LoginUIQrCode) EventScanned ¶
func (u *LoginUIQrCode) EventScanned(res *queryQrCodeResp)
func (*LoginUIQrCode) Show ¶
func (u *LoginUIQrCode) Show(content string)
type MoveFileReq ¶
type MoveFileResp ¶
type RawRequestReq ¶
type RefreshTokenReq ¶
type RefreshTokenReq struct {
RefreshToken string `json:"refresh_token"`
}
type RefreshTokenResp ¶
type RefreshTokenResp struct { DefaultSboxDriveID string `json:"default_sbox_drive_id"` Role string `json:"role"` DeviceID string `json:"device_id"` UserName string `json:"user_name"` NeedLink bool `json:"need_link"` ExpireTime time.Time `json:"expire_time"` PinSetup bool `json:"pin_setup"` NeedRpVerify bool `json:"need_rp_verify"` Avatar string `json:"avatar"` UserData struct { // DingDingRobotURL string `json:"DingDingRobotUrl"` // EncourageDesc string `json:"EncourageDesc"` // FeedBackSwitch bool `json:"FeedBackSwitch"` // FollowingDesc string `json:"FollowingDesc"` DingDingRobotURL string `json:"ding_ding_robot_url"` EncourageDesc string `json:"encourage_desc"` FeedBackSwitch bool `json:"feed_back_switch"` FollowingDesc string `json:"following_desc"` } `json:"user_data"` TokenType string `json:"token_type"` AccessToken string `json:"access_token"` DefaultDriveID string `json:"default_drive_id"` RefreshToken string `json:"refresh_token"` IsFirstLogin bool `json:"is_first_login"` UserID string `json:"user_id"` NickName string `json:"nick_name"` ExistLink []interface{} `json:"exist_link"` State string `json:"state"` ExpiresIn int `json:"expires_in"` Status string `json:"status"` }
func (*RefreshTokenResp) Token ¶
func (r *RefreshTokenResp) Token() *Token
type RenameFileReq ¶
type RenameFileResp ¶
type RenameFileResp struct { DriveID string `json:"drive_id"` SboxUsedSize int `json:"sbox_used_size"` SboxRealUsedSize int `json:"sbox_real_used_size"` SboxTotalSize int64 `json:"sbox_total_size"` RecommendVip string `json:"recommend_vip"` PinSetup bool `json:"pin_setup"` Locked bool `json:"locked"` InsuranceEnabled bool `json:"insurance_enabled"` }
type SearchFileReq ¶
type SearchFileReq struct { DriveID string `json:"drive_id"` Limit int `json:"limit"` Query string `json:"query"` ImageThumbnailProcess string `json:"image_thumbnail_process"` ImageURLProcess string `json:"image_url_process"` VideoThumbnailProcess string `json:"video_thumbnail_process"` OrderBy string `json:"order_by"` }
type ShareLinkService ¶
type ShareLinkService struct {
// contains filtered or unexported fields
}
func (*ShareLinkService) GetShareByAnonymous ¶
func (r *ShareLinkService) GetShareByAnonymous(ctx context.Context, request *GetShareByAnonymousReq) (*GetShareByAnonymousResp, error)
GetShareByAnonymous 通过分享 ID 获取分享内容
type Store ¶
type Store interface { Get(ctx context.Context, key string) (*Token, error) Set(ctx context.Context, token *Token) error }
Store 定义一个存储的接口,使用者可以按照自己的需求来实现
func NewFileStore ¶
type UploadFileReq ¶
type UploadFileResp ¶
type UploadFileResp struct { DriveID string `json:"drive_id"` DomainID string `json:"domain_id"` FileID string `json:"file_id"` Name string `json:"name"` Type string `json:"type"` ContentType string `json:"content_type"` // application/oct-stream CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` FileExtension string `json:"file_extension"` Hidden bool `json:"hidden"` Size int `json:"size"` Starred bool `json:"starred"` Status string `json:"status"` // available UploadID string `json:"upload_id"` ParentFileID string `json:"parent_file_id"` Crc64Hash string `json:"crc64_hash"` ContentHash string `json:"content_hash"` ContentHashName string `json:"content_hash_name"` // sha1 Category string `json:"category"` EncryptMode string `json:"encrypt_mode"` ImageMediaMetadata struct { ImageQuality struct{} `json:"image_quality"` } `json:"image_media_metadata"` Location string `json:"location"` }
Source Files ¶
- aliyundrive.go
- aliyundrive_impl.go
- api_auth_get_self_user.go
- api_auth_get_token.go
- api_auth_login.go
- api_auth_login_qrcode.go
- api_auth_refresh_token.go
- api_file_create_folder.go
- api_file_delete.go
- api_file_download.go
- api_file_get.go
- api_file_get_download_url.go
- api_file_get_file_list.go
- api_file_get_path.go
- api_file_get_sbox.go
- api_file_move.go
- api_file_rename.go
- api_file_search.go
- api_file_upload.go
- api_share_link_get_share_by_anonymous.go
- internal.go
- logger.go
- store.go
- type_enum.go
Click to show internal directories.
Click to hide internal directories.