分离pkg

This commit is contained in:
2024-12-18 03:39:12 +08:00
parent 6f28ddd69b
commit bfe2dd913c
43 changed files with 0 additions and 2957 deletions

View File

@ -1,29 +0,0 @@
package lightCore
import "code.zhecent.com/gopkg/light-core/pkg/myViper"
type Start struct {
config *Config
}
func NewByConfig(config *Config) *Start {
return &Start{config: config}
}
func NewByYAML(fileName string, path string) *Start {
c := &Config{}
myViper.NewSimpleViper(c, "yaml", fileName, path).Apply()
return &Start{config: c}
}
func (t *Start) Start() {
//校验配置
if t.config.App.JwtSecret == "" {
panic("App JwtSecret Empty")
}
if t.config.Server.RunMode == "" || t.config.Server.HttpPort == 0 {
panic("Server Config Error")
}
}