dbhandler

package
v0.0.0-...-09ecf48 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(dbType string, host string, dbName string) (db *sqlx.DB, err error)

Get returns the DB connection

Types

type CockroachDB

type CockroachDB struct {
	Host   string
	Port   string
	User   string
	Dbname string
}

CockroachDB is a conf for the mysql database

func (CockroachDB) NewDBHandler

func (CockroachConf CockroachDB) NewDBHandler() (*sqlx.DB, error)

NewDBHandler connect to db and return the connection

type ConfType

type ConfType interface {
	NewDBHandler() (*sqlx.DB, error)
}

ConfType contains the creation of the handler

type MSSQLDB

type MSSQLDB struct {
	Host     string
	Port     string
	User     string
	Password string
	Dbname   string
}

MSSQLDB is a conf for the mysql database

func (MSSQLDB) NewDBHandler

func (MSSQLConf MSSQLDB) NewDBHandler() (*sqlx.DB, error)

NewDBHandler connect to db and return the connection

type MySQLDB

type MySQLDB struct {
	Protocol string
	Host     string
	Port     string
	User     string
	Password string
	Dbname   string
}

MySQLDB is a conf for the mysql database

func (*MySQLDB) NewDBHandler

func (mysqlConf *MySQLDB) NewDBHandler() (*sqlx.DB, error)

NewDBHandler connect to db and return the connection

type PostgresDB

type PostgresDB struct {
	Host     string
	Port     string
	User     string
	Password string
	Dbname   string
}

PostgresDB is a conf for the mysql database

func (PostgresDB) NewDBHandler

func (PostgresConf PostgresDB) NewDBHandler() (*sqlx.DB, error)

NewDBHandler connect to db and return the connection

type SQLiteDB

type SQLiteDB struct{}

SQLiteDB is used to have to interface valid

func (*SQLiteDB) NewDBHandler

func (sqliteConf *SQLiteDB) NewDBHandler() (*sqlx.DB, error)

NewDBHandler connect to db and return the connection

Jump to

Keyboard shortcuts

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