facade

package
v3.11.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2017 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbFacade

type DbFacade struct {
	SqlDb      *sql.DB
	SqlDbCtrl  *commonDb.DbController
	GormDb     *gorm.DB
	SqlxDb     *sqlx.DB
	SqlxDbCtrl *commonSqlx.DbController
	// contains filtered or unexported fields
}

Gives facade interface supporting multiple object of db

This facade supports:

gorm - github.com/jinzhu/gorm
sqlx - github.com/Cepave/open-falcon-backend/common/db/sqlx
database/sql.DB
dbCtrl

func (*DbFacade) NewDbCtrl

func (facade *DbFacade) NewDbCtrl() *commonDb.DbController

Generates a new controller of sql.DB

func (*DbFacade) NewSqlxDbCtrl

func (facade *DbFacade) NewSqlxDbCtrl() *commonSqlx.DbController

Generates a new controller of sqlx.DB

func (*DbFacade) Open

func (facade *DbFacade) Open(dbConfig *commonDb.DbConfig) (err error)

Open this facade with ping()

func (*DbFacade) Release

func (facade *DbFacade) Release()

Close the database, release the resources

Jump to

Keyboard shortcuts

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