代码拉取完成,页面将自动刷新
// 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}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。