initial commit
This commit is contained in:
40
config/database.go
Normal file
40
config/database.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package config
|
||||
|
||||
import "time"
|
||||
|
||||
// DatabaseConfig holds configuration for database
|
||||
type DatabaseConfig struct {
|
||||
User string
|
||||
Password string
|
||||
Host string
|
||||
Port string
|
||||
Name string
|
||||
MaxIdleConns int
|
||||
MaxOpenConns int
|
||||
ConnMaxIdleTime string
|
||||
ConnMaxLifetime string
|
||||
}
|
||||
|
||||
type PgDatabaseConfig struct {
|
||||
Host string
|
||||
Port int
|
||||
User string
|
||||
Password string
|
||||
Name string
|
||||
SSLMode string
|
||||
ConnectionTimeout time.Duration
|
||||
QueryTimeout time.Duration
|
||||
PoolConfig PgPoolConfig
|
||||
Migrations MigrationsConfig
|
||||
}
|
||||
|
||||
type MigrationsConfig struct {
|
||||
Enabled bool
|
||||
Dir string
|
||||
}
|
||||
type PgPoolConfig struct {
|
||||
MaxConn int32
|
||||
MinConn int32
|
||||
MaxConnLifetime time.Duration
|
||||
MaxConnIdleTime time.Duration
|
||||
}
|
||||
Reference in New Issue
Block a user