1 Star 0 Fork 0

linngc / central-mirror

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
python.go 1.16 KB
一键复制 编辑 原始数据 按行查看 历史
linngc 提交于 2024-03-21 23:01 . add:添加上传附件借口
// Package python
// @Link https://gitee.com/linngc/central-mirror
// @Copyright Copyright (c) 2024 central-mirror CLI
// @Author linngc
// @License
package python
import (
"context"
clientV1 "gitee.com/linngc/central-mirror/contrib/container/core/memorycache/control/client"
"gitee.com/linngc/central-mirror/contrib/speedsdk/toolkit/consts"
"gitee.com/linngc/central-mirror/contrib/speedsdk/toolkit/utility/common"
"runtime"
)
var (
ctx = context.TODO()
numCPU = runtime.NumCPU() + 1
simple = "simple"
packages = "packages"
indexKey = "local"
)
type PythonProxy struct {
ctx context.Context //上下文
GetCommon *common.Common //通用工具类
dial *clientV1.ClientV1 //缓存对象
cfg *PythonConfig //资源配置信息
mirror string //中央仓库代理地址
}
// Client 仓库连接
func Client(ctx context.Context) *PythonProxy {
// init 初始化加载配置文件
cfg := GetPythonConfig()
cosType := common.GetCacheConfig().CosType
d, com := common.GetCommon(ctx, cosType, consts.PROXY_PYTHON, cfg.Mirror)
return &PythonProxy{ctx: ctx, GetCommon: com, dial: d, cfg: cfg, mirror: cfg.Mirror}
}
Go
1
https://gitee.com/linngc/central-mirror.git
git@gitee.com:linngc/central-mirror.git
linngc
central-mirror
central-mirror
bf43de0cf88e

搜索帮助

53164aa7 5694891 3bd8fe86 5694891