1 Star 0 Fork 1

freely随意/BaiduPCS-Go

forked from ttpc2008/BaiduPCS-Go 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
command.go 579 Bytes
一键复制 编辑 原始数据 按行查看 历史
konica 提交于 2018-02-18 09:44 . 增加, 修改注释
// Package pcscommand 命令包
package pcscommand
import (
"github.com/iikira/BaiduPCS-Go/baidupcs"
"github.com/iikira/BaiduPCS-Go/pcsconfig"
"os"
)
var (
info = new(baidupcs.PCSApi)
)
// GetPCSInfo 重载并返回 PCS 配置信息
func GetPCSInfo() *baidupcs.PCSApi {
ReloadInfo()
return info
}
// ReloadInfo 重载配置
func ReloadInfo() {
pcsconfig.Reload()
info = baidupcs.NewPCS(pcsconfig.Config.MustGetActive().BDUSS)
}
// ReloadIfInConsole 程序在 Console 模式下才会重载配置
func ReloadIfInConsole() {
if len(os.Args) == 1 {
ReloadInfo()
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/freelysuiyi/BaiduPCS-Go.git
git@gitee.com:freelysuiyi/BaiduPCS-Go.git
freelysuiyi
BaiduPCS-Go
BaiduPCS-Go
v3.3.1

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385