package
Version:
v0.0.0-...-d152970
Opens a new window with list of versions in this module.
Published: May 16, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
View Source
const (
ProjectName = "hertz-scaffold"
EnvDev = "dev"
EnvTest = "test"
EnvOnline = "online"
)
Init reads config if set.
Set > Flag > Env > Config File > key/Value > Defaults
type AutoGenerated struct {
Logger Logger `yaml:"logger"`
Hertz Hertz `yaml:"hertz"`
Swagger Swagger `yaml:"swagger"`
Mysql Mysql `yaml:"mysql"`
}
GetConf gets configuration instance
type Gorm struct {
IgnoreRecordNotFoundError bool `yaml:"ignoreRecordNotFoundError"`
SlowThreshold int `yaml:"slowThreshold"`
SkipDefaultTx bool `yaml:"skipDefaultTx"`
PrepareStmt bool `yaml:"prepareStmt"`
}
type Hertz struct {
EnableAccessLog bool `yaml:"enableAccessLog"`
ExitWaitTime int `yaml:"exitWaitTime"`
Address string `yaml:"address"`
EnablePprof bool `yaml:"enablePprof"`
}
type Logger struct {
LogMaxBackups int `yaml:"logMaxBackups"`
Level string `yaml:"level"`
Stdout bool `yaml:"stdout"`
LogFileName string `yaml:"logFileName"`
LogMaxSize int `yaml:"logMaxSize"`
LogMaxAge int `yaml:"logMaxAge"`
}
type Mysql struct {
ConnMaxOpen int `yaml:"connMaxOpen"`
ConnMaxLifeTime int `yaml:"connMaxLifeTime"`
Separation bool `yaml:"separation"`
Master string `yaml:"master"`
Slave []string `yaml:"slave"`
DefaultStringSize int `yaml:"defaultStringSize"`
DisableDatetimePrecision bool `yaml:"disableDatetimePrecision"`
ConnMaxIdle int `yaml:"connMaxIdle"`
ConnMaxIdleTime int `yaml:"connMaxIdleTime"`
SkipInitializeWithVersion bool `yaml:"skipInitializeWithVersion"`
Gorm Gorm `yaml:"gorm"`
}
type Swagger struct {
BasePath string `yaml:"basePath"`
Schemes string `yaml:"Schemes"`
Enable bool `yaml:"enable"`
Version string `yaml:"version"`
Host string `yaml:"host"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.