Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CreateMigration ¶
Types ¶
type Config ¶
type Config struct { Driver Driver `env:"DB_DRIVER" envDefault:"mysql"` Host string `env:"DB_HOST" envDefault:"localhost"` Port int `env:"DB_PORT" envDefault:"3306"` User string `env:"DB_USER" envDefault:"root"` Pass string `env:"DB_PASS" envDefault:"password"` DBName string `env:"DB_NAME" envDefault:"shield"` MaxConnLifetime time.Duration `env:"DB_MAX_CONN_LIFETIME" envDefault:"1h"` MaxConnIdleTime time.Duration `env:"DB_MAX_CONN_IDLE_TIME" envDefault:"30m"` MaxIdleConns int `env:"DB_MAX_IDLE_CONNS" envDefault:"10"` MaxOpenConns int `env:"DB_MAX_OPEN_CONNS" envDefault:"100"` // MySQL Charset string `env:"DB_MYSQL_CHARSET" envDefault:"utf8mb4"` ParseTime bool `env:"DB_MYSQL_PARSE_TIME" envDefault:"True"` Location string `env:"DB_MYSQL_LOCATION" envDefault:"Local"` // Postgres SSLMode string `env:"DB_POSTGRES_SSL_MODE" envDefault:"disable"` TimeZone string `env:"DB_POSTGRES_TIME_ZONE" envDefault:"Europe/Madrid"` // CloudSQL UnixSocketPath string `env:"INSTANCE_UNIX_SOCKET"` }
func GetConfigFromEnv ¶
func (*Config) CloudSQLDSN ¶
func (*Config) PostgresDSN ¶
Click to show internal directories.
Click to hide internal directories.