1234567891011121314151617181920212223242526272829303132 |
- package config
- type DsnProvider interface {
- Dsn() string
- }
- type GeneralDB struct {
- Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
- Port string `mapstructure:"port" json:"port" yaml:"port"`
- Config string `mapstructure:"config" json:"config" yaml:"config"`
- Dbname string `mapstructure:"db-name" json:"db-name" yaml:"db-name"`
- Username string `mapstructure:"username" json:"username" yaml:"username"`
- Password string `mapstructure:"password" json:"password" yaml:"password"`
- Path string `mapstructure:"path" json:"path" yaml:"path"`
- Engine string `mapstructure:"engine" json:"engine" yaml:"engine" default:"InnoDB"`
- LogMode string `mapstructure:"log-mode" json:"log-mode" yaml:"log-mode"`
- MaxIdleConns int `mapstructure:"max-idle-conns" json:"max-idle-conns" yaml:"max-idle-conns"`
- MaxOpenConns int `mapstructure:"max-open-conns" json:"max-open-conns" yaml:"max-open-conns"`
- Singular bool `mapstructure:"singular" json:"singular" yaml:"singular"`
- LogZap bool `mapstructure:"log-zap" json:"log-zap" yaml:"log-zap"`
- }
- type SpecializedDB struct {
- Type string `mapstructure:"type" json:"type" yaml:"type"`
- AliasName string `mapstructure:"alias-name" json:"alias-name" yaml:"alias-name"`
- GeneralDB `yaml:",inline" mapstructure:",squash"`
- Disable bool `mapstructure:"disable" json:"disable" yaml:"disable"`
- }
|