1 Star 0 Fork 0

linngc / central-mirror

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
environment_system.go 981 Bytes
一键复制 编辑 原始数据 按行查看 历史
linngc 提交于 2024-05-22 17:45 . fix:修复获取自定义配置yaml方法
// Package environment
// @Link https://gitee.com/linngc/central-mirror
// @Copyright Copyright (c) 2022 webos CLI
// @Author linngc
// @License
package environment
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"os"
)
var (
fileUploadingKey = "@file"
localSystemTryFolders = []string{"", "manifest/", "config/", "manifest/config"}
)
// GetApplicationName 获取当前程序名
func GetApplicationName() string {
return os.Args[0]
}
// GetStaticPath 静态文件夹目录
func GetStaticPath() string {
value, err := g.Cfg().Get(context.TODO(), serverRoot)
if !value.IsEmpty() && err == nil {
return value.String()
}
return ""
}
// GetSwaggerPath 获取swagger api路径
func GetSwaggerPath() string {
value, err := g.Cfg().Get(context.TODO(), swaggerPath)
if !value.IsEmpty() && err == nil {
return value.String()
}
return ""
}
// GetAddress 获取服务 启动 监听端口
func GetAddress() string {
return g.Server().GetListenedAddress()
}
马建仓 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