🎉 Initial commit

This commit is contained in:
landaiqing
2024-08-03 20:34:12 +08:00
parent 93b37f9b46
commit 908a9d10f2
9 changed files with 69 additions and 0 deletions

10
config/conf_logger.go Normal file
View File

@@ -0,0 +1,10 @@
package config
// Logger 配置
type Logger struct {
Level string `yaml:"level"` // 日志级别
Prefix string `yaml:"prefix"` // 日志前缀
Director string `yaml:"director"` // 日志文件存放目录
ShowLine string `yaml:"showLine"` // 是否显示文件行号
LogInConsole string `yaml:"logInConsole"` // 是否在控制台打印日志
}

11
config/conf_mysql.go Normal file
View File

@@ -0,0 +1,11 @@
package config
// MySQL 配置
type MySQL struct {
Host string `yaml:"host"` //主机地址
Port string `yaml:"port"` //端口号
DB string `yaml:"db"` //数据库名
User string `yaml:"user"` //用户名
Password string `yaml:"password"` //密码
LogLevel string `yaml:"log-level"` // 日志级别 debug: 输出全部SQL语句; release: 只输出错误信息
}

8
config/conf_system.go Normal file
View File

@@ -0,0 +1,8 @@
package config
// System 系统配置
type System struct {
Host string `yaml:"host"` //主机地址
Port string `yaml:"port"` //端口号
Env string `yaml:"env"` //环境
}

7
config/config.go Normal file
View File

@@ -0,0 +1,7 @@
package config
type Config struct {
MySQL MySQL `yaml:"mysql"`
Logger Logger `yaml:"logger"`
System System `yaml:"system"`
}