-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a755ad1
commit 6b4d7ba
Showing
3 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
package store | ||
|
||
import "time" | ||
|
||
// Config for database connection | ||
type Config struct { | ||
Host string `mapstructure:"host" default:"localhost"` | ||
User string `mapstructure:"user" default:"postgres"` | ||
Password string `mapstructure:"password" default:""` | ||
Name string `mapstructure:"name" default:"postgres"` | ||
Port string `mapstructure:"port" default:"5432"` | ||
SslMode string `mapstructure:"sslmode" default:"disable"` | ||
LogLevel string `mapstructure:"log_level" default:"info"` | ||
Host string `mapstructure:"host" default:"localhost"` | ||
User string `mapstructure:"user" default:"postgres"` | ||
Password string `mapstructure:"password" default:""` | ||
Name string `mapstructure:"name" default:"postgres"` | ||
Port string `mapstructure:"port" default:"5432"` | ||
SslMode string `mapstructure:"sslmode" default:"disable"` | ||
MaxIdleConns int `yaml:"max_idle_conns" mapstructure:"max_idle_conns" default:"3"` | ||
MaxOpenConns int `yaml:"max_open_conns" mapstructure:"max_open_conns" default:"10"` | ||
ConnMaxLifeTime time.Duration `yaml:"conn_max_life_time" mapstructure:"conn_max_life_time" default:"10ms"` | ||
MaxIdleLifeTime time.Duration `yaml:"idle_max_life_time" mapstructure:"idle_max_life_time" default:"100ms"` | ||
LogLevel string `mapstructure:"log_level" default:"info"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters