Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Pepper string `env:"PEPPER"` Env string `env:"ENV"` FromEmail string `env:"EMAIL_FROM"` Port int `env:"PORT"` JWTSecret string `env:"JWT_SECRET"` Mailgun MailgunConfig `json:"mailgun"` Postgres PostgresConfig `json:"postgres"` }
type MailgunConfig ¶
type MailgunConfig struct { APIKey string `env:"MAILGUN_API_KEY"` PublicKey string `env:"MAILGUN_PUBLIC_KEY"` Domain string `env:"MAILGUN_DOMAIN"` }
func GetMailgunConfig ¶
func GetMailgunConfig() MailgunConfig
type PostgresConfig ¶
type PostgresConfig struct { Host string `env:"POSTGRES_HOST"` Port int `env:"POSTGRES_PORT"` User string `env:"POSTGRES_USER"` Password string `env:"POSTGRES_PASSWORD"` Database string `env:"POSTGRES_DB"` }
PostgresConfig is the config for postgres
func GetPostgresConfig ¶
func GetPostgresConfig() PostgresConfig
GetPostgresConfig returns the postgres config
func (*PostgresConfig) Config ¶
func (c *PostgresConfig) Config() *gorm.Config
db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{}) Dialect returns the dialect for postgres
func (*PostgresConfig) GetConnectionInfo ¶
func (c *PostgresConfig) GetConnectionInfo() gorm.Dialector
GetConnectionInfo returns the connection info for postgres
Click to show internal directories.
Click to hide internal directories.