Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConnection ¶
func GetConnection() *pg.DB
GetConnection returns our pg database connection usage: db := config.GetConnection() defer db.Close()
func GetPostgresSuperUserConnection ¶
func GetPostgresSuperUserConnection() *pg.DB
GetPostgresSuperUserConnection gets the corresponding db connection for our superuser
Types ¶
type Configuration ¶
type Configuration struct {
Server *Server `yaml:"server"`
}
Configuration holds data necessery for configuring application
type JWT ¶
type JWT struct { Realm string `default:"jwtrealm"` Secret string `default:""` Duration int `default:"15"` RefreshDuration int `default:"10"` MaxRefresh int `default:"10"` SigningAlgorithm string `default:"HS256"` }
JWT holds data necessary for JWT configuration
type MagicConfig ¶
MagicConfig persists the config for our Magic services
func GetMagicConfig ¶
func GetMagicConfig() *MagicConfig
GetMagicConfig returns a MagicConfig pointer with the correct Magic.link Config values
type MailConfig ¶
MailConfig persists the config for our PostgreSQL database connection
func GetMailConfig ¶
func GetMailConfig() *MailConfig
GetMailConfig returns a MailConfig pointer with the correct Mail Config values
type PostgresConfig ¶
type PostgresConfig struct { URL string `env:"DATABASE_URL"` // DATABASE_URL will be used in preference if it exists Host string `env:"POSTGRES_HOST" envDefault:"localhost"` Port string `env:"POSTGRES_PORT" envDefault:"5432"` User string `env:"POSTGRES_USER"` Password string `env:"POSTGRES_PASSWORD"` Database string `env:"POSTGRES_DB"` }
PostgresConfig persists the config for our PostgreSQL database connection
func GetPostgresConfig ¶
func GetPostgresConfig() *PostgresConfig
GetPostgresConfig returns a PostgresConfig pointer with the correct Postgres Config values
type PostgresSuperUser ¶
type PostgresSuperUser struct { Host string `env:"POSTGRES_HOST" envDefault:"localhost"` Port string `env:"POSTGRES_PORT" envDefault:"5432"` User string `env:"POSTGRES_SUPERUSER" envDefault:"postgres"` Password string `env:"POSTGRES_SUPERUSER_PASSWORD" envDefault:""` Database string `env:"POSTGRES_SUPERUSER_DB" envDefault:"postgres"` }
PostgresSuperUser persists the config for our PostgreSQL superuser
type Server ¶
type Server struct {
Mode string `yaml:"mode"`
}
Server holds data necessary for server configuration
type SiteConfig ¶
type SiteConfig struct {
ExternalURL string `env:"EXTERNAL_URL" envDefault:"http://localhost:8080"`
}
SiteConfig persists global configs needed for our application
func GetSiteConfig ¶
func GetSiteConfig() *SiteConfig
GetSiteConfig returns a SiteConfig pointer with the correct Site Config values
type TwilioConfig ¶
type TwilioConfig struct { Account string `env:"TWILIO_ACCOUNT"` Token string `env:"TWILIO_TOKEN"` VerifyName string `env:"TWILIO_VERIFY_NAME"` Verify string `env:"TWILIO_VERIFY"` }
TwilioConfig persists the config for our Twilio services
func GetTwilioConfig ¶
func GetTwilioConfig() *TwilioConfig
GetTwilioConfig returns a TwilioConfig pointer with the correct Mail Config values