database

package
v0.0.0-...-111e6d5 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MySQLDockerDsn = fmt.Sprintf("%v:%v@tcp(%s)/%v", "root", "lampupijar77", "mysql-network", "go-ecommerce") //docker
View Source
var MySQLDsn = fmt.Sprintf("%v:%v@/%v", "root", "", "go-ecommerce")

Functions

func MySQL

func MySQL(config string) (*sql.DB, error)

func Postgres

func Postgres(config string) (*sql.DB, error)

Types

type Databases

type Databases struct {
	MySQL   *sql.DB
	Postgre *sql.DB
}
var DB Databases

func Init

func Init(data map[string]interface{}) *Databases

func (*Databases) SetMysql

func (d *Databases) SetMysql(dsn string)

func (*Databases) SetPostgre

func (d *Databases) SetPostgre(dsn string)

func (*Databases) TestPing

func (d *Databases) TestPing(dbNames []string)

type Methods

type Methods interface {
	SetMysql(dsn string)
	SetPostgre(dsn string)
	TestPing(dbNames []string)
}

Jump to

Keyboard shortcuts

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