conf

package
v0.0.0-...-ee611d5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *gorm.DB

Functions

func InitializeDb

func InitializeDb(dbHost string, username string, dbName string, port int, password string)

InitializeDb takes the database connection information as arguments . Creates a connection to the db and set the connection to the pointer Db *gorm.DB .

func MakeMigrations

func MakeMigrations()

MakeMigrations auto migrate the passed models.

Types

type DbConfig

type DbConfig struct {
	DbUser     string `env:"DB_USER"`
	DbPassword string `env:"DB_PASSWORD"`
	DbPort     int    `env:"DB_PORT" envDefault:"5432"`
	DbHost     string `env:"DB_HOST"`
	DbName     string `env:"DB_NAME"`
}

Jump to

Keyboard shortcuts

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