13 lines
		
	
	
		
			963 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			963 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package config
 | |
| 
 | |
| type DB struct {
 | |
| 	Driver       string `mapstructure:"driver" json:"driver" yaml:"driver"`                         // 数据库类型
 | |
| 	Host         string `mapstructure:"host" json:"host" yaml:"host"`                               // 数据库地址
 | |
| 	Port         int    `mapstructure:"port" json:"port" yaml:"port"`                               // 数据库端口
 | |
| 	Username     string `mapstructure:"username" json:"username" yaml:"username"`                   // 数据库用户
 | |
| 	Password     string `mapstructure:"password" json:"password" yaml:"password"`                   // 数据库密码
 | |
| 	DBName       string `mapstructure:"db_name" json:"db_name" yaml:"db_name"`                      // 数据库名称
 | |
| 	MaxOpenConns int    `mapstructure:"max_open_conns" json:"max_open_conns" yaml:"max_open_conns"` // 数据库名称
 | |
| 	MaxIdleConns int    `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"` // 数据库名称
 | |
| }
 |