Versions in this module Expand all Collapse all v0 v0.9.0 Mar 23, 2022 v0.8.0 Mar 9, 2022 v0.7.0 Mar 7, 2022 v0.6.0 Mar 4, 2022 Changes in this version type UploadFileReq + ShowProgressBar bool v0.5.0 Mar 3, 2022 v0.4.0 Feb 21, 2022 Changes in this version + type LoginByQrcodeReq struct + SmallQrCode bool v0.3.0 Feb 6, 2022 v0.2.0 Feb 1, 2022 Changes in this version + const RootFileID type ClientOptionFunc + func WithStore(store Store) ClientOptionFunc type DownloadFileReq + ShowProgressBar bool type FileService + func (r *FileService) DownloadFileStream(ctx context.Context, driveID, fileID string) (io.ReadCloser, error) + func (r *FileService) UploadStream(ctx context.Context, driveID, parentID, name string, stream io.Reader, ...) (*UploadFileResp, error) + type FileType string + const FileTypeFile + const FileTypeFolder type GetFileListReq + ShareID string v0.1.0 Sep 13, 2021 Changes in this version + func IsTokenExpired(err error) bool + type AliyunDrive struct + Auth *AuthService + File *FileService + ShareLink *ShareLinkService + func New(options ...ClientOptionFunc) *AliyunDrive + func (r *AliyunDrive) RawRequest(ctx context.Context, req *RawRequestReq, resp interface{}) (*Response, error) + type AuthService struct + func (r *AuthService) GetSelfUser(ctx context.Context) (*GetSelfUserResp, error) + func (r *AuthService) LoginByQrcode(ctx context.Context) (*GetSelfUserResp, error) + func (r *AuthService) RefreshToken(ctx context.Context, request *RefreshTokenReq) (*RefreshTokenResp, error) + type ClientOptionFunc func(*AliyunDrive) + func WithLogger(logger Logger, level LogLevel) ClientOptionFunc + func WithWorkDir(dir string) ClientOptionFunc + type CreateFolderReq struct + CheckNameMode string + DriveID string + Name string + ParentFileID string + Type string + type CreateFolderResp struct + DomainID string + DriveID string + EncryptMode string + FileID string + FileName string + ParentFileID string + Type string + type DefaultLogger struct + func (l *DefaultLogger) Log(ctx context.Context, level LogLevel, msg string, args ...interface{}) + type DeleteFileReq struct + DriveID string + FileID string + type DeleteFileResp struct + AsyncTaskID string + DomainID string + DriveID string + FileID string + type DownloadFileConflictType int + const DownloadFileConflictTypeAutoRename + const DownloadFileConflictTypeError + const DownloadFileConflictTypeOverwrite + type DownloadFileReq struct + ConflictType DownloadFileConflictType + Dist string + DistDir string + DriveID string + FileID string + type File struct + Category string + ContentHash string + ContentHashName string + ContentType string + Crc64Hash string + CreatedAt time.Time + DomainID string + DownloadURL string + DriveID string + EncryptMode string + FileExtension string + FileID string + Hidden bool + MimeExtension string + MimeType string + Name string + ParentFileID string + PunishFlag int + Size int64 + Starred bool + Status string + Thumbnail string + Type string + URL string + UpdatedAt time.Time + UserMeta string + type FileService struct + 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) 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) + type FileStore struct + func (r *FileStore) Get(ctx context.Context, key string) (*Token, error) + func (r *FileStore) Set(ctx context.Context, token *Token) error + type GetFileDownloadURLReq struct + DriveID string + FileID string + type GetFileDownloadURLResp struct + CdnURL string + Expiration time.Time + InternalURL string + Method string + RateLimit struct{ ... } + Size int + URL string + type GetFileListReq struct + All bool + DriveID string + Fields string + GetAll bool + ImageThumbnailProcess string + ImageURLProcess string + Limit int + Marker string + OrderBy string + OrderDirection string + ParentFileID string + URLExpireSec int + VideoThumbnailProcess string + type GetFileListResp struct + Items []*File + NextMarker string + type GetFilePathReq struct + DriveID string + FileID string + type GetFilePathResp struct + Items []*File + type GetFileReq struct + DriveID string + FileID string + type GetFileResp struct + Trashed bool + type GetSBoxResp struct + DriveID string + InsuranceEnabled bool + Locked bool + PinSetup bool + RecommendVip string + SboxRealUsedSize int + SboxTotalSize int64 + SboxUsedSize int + type GetSelfUserResp struct + Avatar string + CreatedAt int64 + DefaultDriveID string + DenyChangePasswordBySelf bool + Description string + DomainID string + Email string + NeedChangePasswordNextLogin bool + NickName string + Permission interface{} + Phone string + Role string + Status string + UpdatedAt int64 + UserID string + UserName string + type GetShareByAnonymousReq struct + ShareID string + type GetShareByAnonymousResp struct + Avatar string + CreatorID string + CreatorName string + CreatorPhone string + Expiration string + FileCount int + FileInfos []struct{ ... } + ShareName string + UpdatedAt time.Time + Vip string + type LogLevel int + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelTrace + const LogLevelWarn + func (r LogLevel) String() string + type Logger interface + Log func(ctx context.Context, level LogLevel, msg string, args ...interface{}) + func NewLoggerStdout() Logger + type LoggerStdout struct + func (l *LoggerStdout) Log(ctx context.Context, level LogLevel, msg string, args ...interface{}) + type MoveFileReq struct + DriveID string + FileID string + ToDriveID string + ToParentFileID string + type MoveFileResp struct + DomainID string + DriveID string + FileID string + type RawRequestReq struct + API string + Body interface{} + IsFile bool + Method string + Scope string + URL string + type RefreshTokenReq struct + RefreshToken string + type RefreshTokenResp struct + AccessToken string + Avatar string + DefaultDriveID string + DefaultSboxDriveID string + DeviceID string + ExistLink []interface{} + ExpireTime time.Time + ExpiresIn int + IsFirstLogin bool + NeedLink bool + NeedRpVerify bool + NickName string + PinSetup bool + RefreshToken string + Role string + State string + Status string + TokenType string + UserData struct{ ... } + UserID string + UserName string + func (r *RefreshTokenResp) Token() *Token + type RenameFileReq struct + CheckNameMode string + DriveID string + FileID string + Name string + type RenameFileResp struct + DriveID string + InsuranceEnabled bool + Locked bool + PinSetup bool + RecommendVip string + SboxRealUsedSize int + SboxTotalSize int64 + SboxUsedSize int + type Response struct + Body []byte + ContentLength int64 + Header http.Header + Method string + StatusCode int + URL string + type SearchFileReq struct + DriveID string + ImageThumbnailProcess string + ImageURLProcess string + Limit int + OrderBy string + Query string + VideoThumbnailProcess string + type ShareLinkService struct + func (r *ShareLinkService) GetShareByAnonymous(ctx context.Context, request *GetShareByAnonymousReq) (*GetShareByAnonymousResp, error) + type Store interface + Get func(ctx context.Context, key string) (*Token, error) + Set func(ctx context.Context, token *Token) error + func NewFileStore(file string) Store + type Token struct + AccessToken string + ExpiredAt time.Time + RefreshToken string + type UploadFileReq struct + DriveID string + FilePath string + ParentID string + type UploadFileResp struct + Category string + ContentHash string + ContentHashName string + ContentType string + Crc64Hash string + CreatedAt time.Time + DomainID string + DriveID string + EncryptMode string + FileExtension string + FileID string + Hidden bool + ImageMediaMetadata struct{ ... } + Location string + Name string + ParentFileID string + Size int + Starred bool + Status string + Type string + UpdatedAt time.Time + UploadID string