sys_init.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package model
  2. // 程序初始化yaml配置文件
  3. type DbInitConfig struct {
  4. Database Database `json:"database" yaml:"database"`
  5. Redis Redis `json:"redis" yaml:"redis"`
  6. }
  7. type Database struct {
  8. Default DbDefault `json:"default" yaml:"default"`
  9. }
  10. type DbDefault struct {
  11. Host string `json:"host" yaml:"host"`
  12. Port int `json:"port" yaml:"port"`
  13. User string `json:"user" yaml:"user"`
  14. Pass string `json:"pass" yaml:"pass"`
  15. Name string `json:"name" yaml:"name"`
  16. Type string `json:"type" yaml:"type"`
  17. Role string `json:"role" yaml:"role"`
  18. Debug bool `json:"debug" yaml:"debug"`
  19. Charset string `json:"charset" yaml:"charset"`
  20. DryRun bool `json:"dryRun" yaml:"dryRun"`
  21. MaxIdle int `json:"maxIdle" yaml:"maxIdle"`
  22. MaxOpen int `json:"maxOpen" yaml:"maxOpen"`
  23. MaxLifetime int `json:"maxLifetime" yaml:"maxLifetime"`
  24. }
  25. type Redis struct {
  26. Default RedisDefault `json:"default" yaml:"default"`
  27. }
  28. type RedisDefault struct {
  29. Address string `json:"address" yaml:"address"`
  30. Db int `json:"db" yaml:"db"`
  31. Pass string `json:"pass" yaml:"pass"`
  32. IdleTimeout int `json:"idleTimeout" yaml:"idleTimeout"`
  33. MaxActive int `json:"maxActive" yaml:"maxActive"`
  34. }