database

package
v0.0.0-...-ffaa9e0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close close existing connection

func Open

func Open() *gorm.DB

Open create new connection to DB with default config

func OpenDatabase

func OpenDatabase(driver, url string) *gorm.DB

OpenDatabase Open Connection to database with specific settings

func OpenMongoDb

func OpenMongoDb() *mongo.Database

Types

type DbFactory

type DbFactory struct {
	Driver string
	URL    string
}

DbFactory hold all database connection configuration

func GetFactory

func GetFactory() *DbFactory

GetFactory get DatabaseFactory instance

func SetupFactory

func SetupFactory(driver, url string) *DbFactory

SetupFactory setup DatabaseFactory

Jump to

Keyboard shortcuts

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