initializers

package
v0.0.0-...-83acdd3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func ConnectDB

func ConnectDB(config *DBConfig)

func ConnectStorage

func ConnectStorage() (*storage.Client, error)

Types

type DBConfig

type DBConfig struct {
	Environment   string `mapstructure:"ENV"`
	InternalDBURL string `mapstructure:"INTERNAL_DB_URL"`
	ExternalDBURL string `mapstructure:"EXTERNAL_DB_URL"`

	DBHost         string `mapstructure:"POSTGRES_HOST"`
	DBUserName     string `mapstructure:"POSTGRES_USER"`
	DBUserPassword string `mapstructure:"POSTGRES_PASSWORD"`
	DBName         string `mapstructure:"POSTGRES_DB"`
	DBPort         string `mapstructure:"POSTGRES_PORT"`
	ServerPort     string `mapstructure:"PORT"`

	ClientOrigin string `mapstructure:"CLIENT_ORIGIN"`

	TokenSecret    string        `mapstructure:"TOKEN_SECRET"`
	TokenExpiresIn time.Duration `mapstructure:"TOKEN_EXPIRED_IN"`
	TokenMaxAge    int           `mapstructure:"TOKEN_MAXAGE"`

	EmailFrom string `mapstructure:"EMAIL_FROM"`
	SMTPHost  string `mapstructure:"SMTP_HOST"`
	SMTPPass  string `mapstructure:"SMTP_PASS"`
	SMTPPort  int    `mapstructure:"SMTP_PORT"`
	SMTPUser  string `mapstructure:"SMTP_USER"`

	FirebaseStorageFile string `mapstructure:"FIREBASE_STORAGE_FILE"`
	FirebaseBucketName  string `mapstructure:"FIREBASE_BUCKET_NAME"`

	IPServiceUrl string `mapstructure:"IP_SERVICE_URL"`
}

func LoadConfig

func LoadConfig(path string) (config DBConfig, err error)

Jump to

Keyboard shortcuts

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