package config // ServerConfig 服务器配置 type ServerConfig struct { Port int `yaml:"port"` } // MySQLConfig MySQL数据库配置 type MySQLConfig struct { Host string `yaml:"host"` Port int `yaml:"port"` Username string `yaml:"username"` Password string `yaml:"password"` Dbname string `yaml:"dbname"` Charset string `yaml:"charset"` ParseTime bool `yaml:"parseTime"` Loc string `yaml:"loc"` } // JWTConfig JWT配置 type JWTConfig struct { Secret string `yaml:"secret"` Expire int `yaml:"expire"` } // RedisConfig Redis配置 type RedisConfig struct { Host string `yaml:"host"` Port int `yaml:"port"` Password string `yaml:"password"` DB int `yaml:"db"` PoolSize int `yaml:"poolSize"` } // Config 配置结构体 type Config struct { Server ServerConfig `yaml:"server"` MySQL MySQLConfig `yaml:"mysql"` JWT JWTConfig `yaml:"jwt"` Redis RedisConfig `yaml:"redis"` }