1 Star 0 Fork 0

linngc / central-mirror

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
maven.go 1004 Bytes
一键复制 编辑 原始数据 按行查看 历史
linngc 提交于 2024-05-20 15:30 . add:添加sdk发布历史接口
// Package maven
// @Link https://gitee.com/linngc/central-mirror
// @Copyright Copyright (c) 2024 central-mirror CLI
// @Author linngc
// @License
package maven
import (
"context"
clientV1 "gitee.com/linngc/central-mirror/contrib/container/core/memorycache/control/client"
"gitee.com/linngc/central-mirror/contrib/pluginsdk/speedsdk/consts/enums"
"gitee.com/linngc/central-mirror/contrib/pluginsdk/speedsdk/utility/storage"
)
var ctx = context.TODO()
type MavenProxy struct {
ctx context.Context //上下文
Com *storage.Storage //通用工具类
dial *clientV1.ClientV1 //缓存对象
cfg *MavenConfig //资源配置信息
mirror string //中央仓库代理地址
}
// Client 仓库连接
func Client(ctx context.Context) *MavenProxy {
// init 初始化加载配置文件
cfg := GetMavenConfig()
d, com, _ := storage.GetGlobalCache(ctx, enums.ProxyMaven, cfg.Mirror)
return &MavenProxy{ctx: ctx, Com: com, dial: d, cfg: cfg, mirror: cfg.Mirror}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/linngc/central-mirror.git
git@gitee.com:linngc/central-mirror.git
linngc
central-mirror
central-mirror
a6b6bab2d6e5

搜索帮助

344bd9b3 5694891 D2dac590 5694891