gorm.go 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package config
  2. type Mysql struct {
  3. Path string `mapstructure:"path" json:"path" yaml:"path"`
  4. Config string `mapstructure:"config" json:"config" yaml:"config"`
  5. Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
  6. Username string `mapstructure:"username" json:"username" yaml:"username"`
  7. Password string `mapstructure:"password" json:"password" yaml:"password"`
  8. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  9. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  10. LogMode bool `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
  11. }
  12. type Postgresql struct {
  13. Host string `mapstructure:"host" json:"host" yaml:"host"`
  14. Port string `mapstructure:"port" json:"port" yaml:"port"`
  15. Config string `mapstructure:"config" json:"config" yaml:"config"`
  16. Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
  17. Username string `mapstructure:"username" json:"username" yaml:"username"`
  18. Password string `mapstructure:"password" json:"password" yaml:"password"`
  19. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  20. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  21. PreferSimpleProtocol bool `mapstructure:"prefer-simple-protocol" json:"preferSimpleProtocol" yaml:"prefer-simple-protocol"`
  22. Logger bool `mapstructure:"logger" json:"logger" yaml:"logger"`
  23. }
  24. type Sqlite struct {
  25. Path string `mapstructure:"path" json:"path" yaml:"path"`
  26. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  27. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  28. Logger bool `mapstructure:"logger" json:"logger" yaml:"logger"`
  29. }
  30. type Sqlserver struct {
  31. Path string `mapstructure:"path" json:"path" yaml:"path"`
  32. Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
  33. Username string `mapstructure:"username" json:"username" yaml:"username"`
  34. Password string `mapstructure:"password" json:"password" yaml:"password"`
  35. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  36. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  37. Logger bool `mapstructure:"logger" json:"logger" yaml:"logger"`
  38. }