database

package
v0.0.0-...-de2e133 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *gorm.DB

Db is the database object

Functions

func Init

func Init() error

Init Initializes a db connection

func Migrate

func Migrate()

Migrate executes migrations once the db is connected

Types

type Config

type Config struct {
	User     string `env:"DB_USER"`
	Password string `env:"DB_PASSWORD"`
	Port     uint64 `env:"DB_PORT" envDefault:"5432"`
	Host     string `env:"DB_HOST"`
	Name     string `env:"DB_NAME"`
	DbURL    string `env:"DATABASE_URL"`
}

Config is the structure used to load db credentials from the environment.

Jump to

Keyboard shortcuts

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