From 537f028d2ada098258a21aeb34d9db8ff34e862b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 31 Jul 2023 11:19:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0mysql=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api2sql/define/config.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 api2sql/define/config.go diff --git a/api2sql/define/config.go b/api2sql/define/config.go new file mode 100644 index 0000000..f4bde73 --- /dev/null +++ b/api2sql/define/config.go @@ -0,0 +1,33 @@ +// Package define ... +// +// Description : define ... +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 2023-07-31 10:36 +package define + +// MysqlConfig mysql数据库配置结构 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 10:53 2023/7/31 +type MysqlConfig struct { + Host string `json:"host" gorm:"host" ini:"host" xml:"host" yaml:"host"` // 服务器地址 + Port int `json:"port" gorm:"port" ini:"port" xml:"port" yaml:"port"` // 端口 + Username string `json:"username" gorm:"username" ini:"username" xml:"username" yaml:"username"` // 用户名 + Password string `json:"password" gorm:"password" ini:"password" xml:"password" yaml:"password"` // 密码 + +} + +// LoggerConfig 日志配置 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 10:54 2023/7/31 +type LoggerConfig struct { + LogPath string `json:"log_path" gorm:"log_path" ini:"log_path" xml:"log_path" yaml:"log_path"` // 日志路径, 不包含文件名, 相对路径, 则日志存储与项目路径下 + Level int `json:"level" gorm:"level" ini:"level" xml:"level" yaml:"level"` // 日志等级 + Console bool `json:"console" gorm:"console" ini:"console" xml:"console" yaml:"console"` // 控制台输出 + Split string `json:"split" gorm:"split" ini:"split" xml:"split" yaml:"split"` // 切割规则 : 小时 / 天 +}