config.go 2.2 KB

123456789101112131415161718192021222324252627282930
  1. package config
  2. type Config struct {
  3. Log Log `mapstructure:"log" json:"log" yaml:"log"`
  4. Serve Serve `mapstructure:"serve" json:"serve" yaml:"serve"`
  5. }
  6. // Serve gin服务配置
  7. type Serve struct {
  8. Port int `mapstructure:"port" json:"port" yaml:"port" description:"gin开启监听http服务的端口"`
  9. RunMode string `mapstructure:"run-mode" json:"run-mode" yaml:"run-mode" description:"gin运行模式的默认,枚举值:debug,release"`
  10. UseRedis bool `mapstructure:"use-redis" json:"use-redis" yaml:"use-redis" description:"是否使用redis"`
  11. AppName string `mapstructure:"app-name" json:"app-name" yaml:"app-name" description:"项目名称"`
  12. StaticDir string `mapstructure:"static-dir" json:"static-dir" yaml:"static-dir" description:"上传的文件存储目录地址"`
  13. LibreOfficePath string `mapstructure:"libreOfficePath" json:"libreOfficePath" yaml:"libreOfficePath" description:"办公软件相关组件"`
  14. }
  15. // Log 日志配置
  16. type Log struct {
  17. Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix" description:"日志输出前缀"`
  18. LogFile bool `mapstructure:"log-file" json:"logFile" yaml:"log-file" description:""`
  19. Stdout string `mapstructure:"stdout" json:"stdout" yaml:"stdout" description:""`
  20. FileStdout string `mapstructure:"file-stdout" json:"file-stdout" yaml:"file-stdout" description:""`
  21. SaveMaxDay int `mapstructure:"save-max-day" json:"save-max-day" yaml:"save-max-day" description:"最多保留多少天的日志"`
  22. CuttingDay int `mapstructure:"cutting-day" json:"cutting-day" yaml:"cutting-day" description:"相隔几天切割文件"`
  23. LogDirPath string `mapstructure:"log-dir-path" json:"log-dir-path" yaml:"log-dir-path" description:"日志目录"`
  24. LogSoftLink string `mapstructure:"log-soft-link" json:"log-soft-link" yaml:"log-soft-link" description:"日志软链接"`
  25. BinlogDirPath string `mapstructure:"binlog-dir-path" json:"binlog-dir-path" yaml:"binlog-dir-path" description:"binlog日志目录"`
  26. BinlogSoftLink string `mapstructure:"binlog-soft-link" json:"binlog-soft-link" yaml:"binlog-soft-link" description:"binlog日志软链接"`
  27. }