mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-12 04:03:44 +08:00
发布v2.15.1版本,更新内容请查看:https://github.com/bufanyun/hotgo/blob/v2.0/docs/guide-zh-CN/start-update-log.md
This commit is contained in:
31
server/utility/simple/system_config.go
Normal file
31
server/utility/simple/system_config.go
Normal file
@@ -0,0 +1,31 @@
|
||||
// Package simple
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package simple
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// AppName 应用名称
|
||||
func AppName(ctx context.Context) string {
|
||||
return g.Cfg().MustGet(ctx, "system.appName", "hotgo").String()
|
||||
}
|
||||
|
||||
// Debug debug
|
||||
func Debug(ctx context.Context) bool {
|
||||
return g.Cfg().MustGet(ctx, "system.debug", true).Bool()
|
||||
}
|
||||
|
||||
// IsDemo 是否为演示系统
|
||||
func IsDemo(ctx context.Context) bool {
|
||||
return g.Cfg().MustGet(ctx, "system.isDemo", true).Bool()
|
||||
}
|
||||
|
||||
// IsCluster 是否为集群部署
|
||||
func IsCluster(ctx context.Context) bool {
|
||||
return g.Cfg().MustGet(ctx, "system.isCluster", true).Bool()
|
||||
}
|
||||
Reference in New Issue
Block a user