configs

package
v0.0.0-...-750da50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 8 Imported by: 0

README

Configs

This directory's purpose:

  • Define application configs (using environmental variables)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupFirebase

func SetupFirebase() *auth.Client

SetupFirebase for firebase auth

Types

type Config

type Config struct {
	Env       string         `env:"ENV"`
	Pepper    string         `env:"PEPPER"`
	HMACKey   string         `env:"HMAC_KEY"`
	Postgres  PostgresConfig `json:"postgres"`
	Mailgun   MailgunConfig  `json:"mailgun"`
	JWTSecret string         `env:"JWT_SIGN_KEY"`
	Host      string         `env:"APP_HOST"`
	Port      string         `env:"APP_PORT"`
	FromEmail string         `env:"EMAIL_FROM"`
}

Config object

func GetConfig

func GetConfig() Config

GetConfig gets all config for the application

func (Config) IsProd

func (c Config) IsProd() bool

IsProd Checks if env is production

type MailgunConfig

type MailgunConfig struct {
	APIKey string `env:"MAILGUN_API_KEY"`
	// PublicAPIKey string `env:"MAILGUN_PUBLIC_KEY"`
	Domain string `env:"MAILGUN_DOMAIN"`
}

MailgunConfig object

func GetMailgunConfig

func GetMailgunConfig() MailgunConfig

GetMailgunConfig get Mainlgun config object

type PostgresConfig

type PostgresConfig struct {
	Host     string `env:"DB_HOST"`
	Port     int    `env:"DB_PORT"`
	User     string `env:"DB_USER"`
	Password string `env:"DB_PASSWORD"`
	Name     string `env:"DB_NAME"`
}

PostgresConfig object

func GetPostgresConfig

func GetPostgresConfig() PostgresConfig

GetPostgresConfig returns PostgresConfig object

func (PostgresConfig) Dialect

func (c PostgresConfig) Dialect() string

Dialect returns "postgres"

func (PostgresConfig) GetPostgresConnectionInfo

func (c PostgresConfig) GetPostgresConnectionInfo() string

GetPostgresConnectionInfo returns Postgres URL string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL