1 Star 0 Fork 1

ttpc2008 / BaiduPCS-Go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
quota.go 490 Bytes
一键复制 编辑 原始数据 按行查看 历史
package pcscommand
import (
"fmt"
"github.com/iikira/BaiduPCS-Go/pcsutil/converter"
)
// RunGetQuota 执行 获取当前用户空间配额信息, 并输出
func RunGetQuota() {
quota, used, err := GetBaiduPCS().QuotaInfo()
if err != nil {
fmt.Println(err)
return
}
fmt.Printf("用户名: %s, 总空间: %s, 已用空间: %s, 比率: %f%%\n",
GetActiveUser().Name,
converter.ConvertFileSize(quota),
converter.ConvertFileSize(used),
100*float64(used)/float64(quota),
)
}
1
https://gitee.com/ttpc2008/BaiduPCS-Go.git
git@gitee.com:ttpc2008/BaiduPCS-Go.git
ttpc2008
BaiduPCS-Go
BaiduPCS-Go
v3.5.6

搜索帮助