config

package module
v0.0.0-...-5792208 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: MIT Imports: 6 Imported by: 0

README

go-database-connection

Golang package to connect with database

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

DB db object

Functions

func GetDB

func GetDB() (*sql.DB, error)

GetDB same as getDB but returns an error when it cannot connect.

Types

type DBConfig

type DBConfig struct {
	Host     string
	Port     int64
	User     string
	DBName   string
	DBName2  string
	Password string
}

DBConfig represents db configuration

func BuildDBConfig

func BuildDBConfig() DBConfig

BuildDBConfig builds db config object from environment variables

func (DBConfig) DbURL

func (dbConfig DBConfig) DbURL() string

DbURL get db connection string

Jump to

Keyboard shortcuts

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