1 Star 0 Fork 0

蒙蒙的男孩 / eosc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
utils.go 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
蒙蒙的男孩 提交于 2024-01-10 13:49 . 重定义项目地址
package extends
import (
"fmt"
"path/filepath"
"runtime"
"strings"
"gitee.com/meng_mengs_boys/eosc"
"gitee.com/meng_mengs_boys/eosc/env"
)
func LocalExtenderPath(group, project, version string) string {
fileName := FormatFileName(group, project, version)
return filepath.Join(env.ExtendersDir(), "repository", eosc.Version(), runtime.Version(), group, project, version, fileName)
}
func DecodeExtenderId(id string) (group, project, version string, err error) {
vs := strings.Split(id, ":")
if len(vs) == 2 {
return vs[0], vs[1], "", nil
}
if len(vs) == 3 {
return vs[0], vs[1], vs[2], nil
}
return "", "", "", fmt.Errorf("%w:%s", ErrorInvalidExtenderId, id)
}
func FormatProject(group, project string) string {
return fmt.Sprint(group, ":", project)
}
func FormatDriverId(group, project, fac string) string {
return fmt.Sprint(group, ":", project, ":", fac)
}
func FormatFileName(group, project, version string) string {
return fmt.Sprint(group, "-", project, "-", version, "-", runtime.Version(), "-", eosc.Version(), "-", runtime.GOOS, "-", runtime.GOARCH)
}
func LocalExtendTarPath(group, project, version string) string {
return filepath.Join(env.ExtendersDir(), "repository", eosc.Version(), runtime.Version(), group, project, version, FormatFileName(group, project, version)+tarSuffix)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/meng_mengs_boys/eosc.git
git@gitee.com:meng_mengs_boys/eosc.git
meng_mengs_boys
eosc
eosc
v1.15.4

搜索帮助

344bd9b3 5694891 D2dac590 5694891