mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-12-26 18:15:59 +08:00
This commit is contained in:
@@ -83,27 +83,13 @@ func (s *sSysConfig) InitConfig(ctx context.Context) {
|
||||
|
||||
}
|
||||
|
||||
// GetLoadTCP 获取本地tcp配置
|
||||
func (s *sSysConfig) GetLoadTCP(ctx context.Context) (conf *model.TCPConfig, err error) {
|
||||
err = g.Cfg().MustGet(ctx, "tcp").Scan(&conf)
|
||||
return
|
||||
}
|
||||
|
||||
// GetLoadCache 获取本地缓存配置
|
||||
func (s *sSysConfig) GetLoadCache(ctx context.Context) (conf *model.CacheConfig, err error) {
|
||||
err = g.Cfg().MustGet(ctx, "cache").Scan(&conf)
|
||||
return
|
||||
}
|
||||
|
||||
// GetLoadGenerate 获取本地生成配置
|
||||
func (s *sSysConfig) GetLoadGenerate(ctx context.Context) (conf *model.GenerateConfig, err error) {
|
||||
err = g.Cfg().MustGet(ctx, "hggen").Scan(&conf)
|
||||
return
|
||||
}
|
||||
|
||||
// GetLoadToken 获取本地token配置
|
||||
func (s *sSysConfig) GetLoadToken(ctx context.Context) (conf *model.TokenConfig, err error) {
|
||||
err = g.Cfg().MustGet(ctx, "token").Scan(&conf)
|
||||
// GetLogin 获取登录配置
|
||||
func (s *sSysConfig) GetLogin(ctx context.Context) (conf *model.LoginConfig, err error) {
|
||||
models, err := s.GetConfigByGroup(ctx, sysin.GetConfigInp{Group: "login"})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = gconv.Scan(models.List, &conf)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -182,6 +168,30 @@ func (s *sSysConfig) GetBasic(ctx context.Context) (conf *model.BasicConfig, err
|
||||
return
|
||||
}
|
||||
|
||||
// GetLoadTCP 获取本地tcp配置
|
||||
func (s *sSysConfig) GetLoadTCP(ctx context.Context) (conf *model.TCPConfig, err error) {
|
||||
err = g.Cfg().MustGet(ctx, "tcp").Scan(&conf)
|
||||
return
|
||||
}
|
||||
|
||||
// GetLoadCache 获取本地缓存配置
|
||||
func (s *sSysConfig) GetLoadCache(ctx context.Context) (conf *model.CacheConfig, err error) {
|
||||
err = g.Cfg().MustGet(ctx, "cache").Scan(&conf)
|
||||
return
|
||||
}
|
||||
|
||||
// GetLoadGenerate 获取本地生成配置
|
||||
func (s *sSysConfig) GetLoadGenerate(ctx context.Context) (conf *model.GenerateConfig, err error) {
|
||||
err = g.Cfg().MustGet(ctx, "hggen").Scan(&conf)
|
||||
return
|
||||
}
|
||||
|
||||
// GetLoadToken 获取本地token配置
|
||||
func (s *sSysConfig) GetLoadToken(ctx context.Context) (conf *model.TokenConfig, err error) {
|
||||
err = g.Cfg().MustGet(ctx, "token").Scan(&conf)
|
||||
return
|
||||
}
|
||||
|
||||
// GetLoadSSL 获取本地日志配置
|
||||
func (s *sSysConfig) GetLoadSSL(ctx context.Context) (conf *model.SSLConfig, err error) {
|
||||
err = g.Cfg().MustGet(ctx, "hotgo.ssl").Scan(&conf)
|
||||
|
||||
Reference in New Issue
Block a user