go-aliyundrive
go-aliyundrive copied to clipboard
阿里云盘 Go SDK
go-aliyundrive
阿里云盘 Go SDK
安装
go get github.com/chyroc/go-aliyundrive
使用
初始化 SDK 实例
ins := aliyundrive.New()
// 下面所有提到的 ins 都是指这个实例
登录
具体代码参考这里
user, err := ins.Auth.LoginByQrcode(context.TODO())
![](https://github.com/chyroc/go-aliyundrive/raw/master/screenshots/login-by-qrcode.png)
读取文件
具体代码参考这里
resp, err := ins.File.GetFileList(context.TODO(), &aliyundrive.GetFileListReq{
DriveID: driveID,
ParentFileID: parentID,
Marker: next,
})
![](https://github.com/chyroc/go-aliyundrive/raw/master/screenshots/list-files.png)
获取分享的内容
具体代码参考这里
sharedInfo, err := ins.ShareLink.GetShareByAnonymous(ctx, &aliyundrive.GetShareByAnonymousReq{
ShareID: shareID,
})
![](https://github.com/chyroc/go-aliyundrive/raw/master/screenshots/get-share.png)
其他
- 阿里云盘命令行客户端: https://github.com/chyroc/aliyundrive-cli