rdbms

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectManager

type ConnectManager interface {
	Init(*Env) (*sql.DB, error)
	Destroy(*sql.DB) error
}

ConnectManager func define

func NewMysqlConnectManager

func NewMysqlConnectManager() ConnectManager

NewMysqlConnectManager new a database manager

func NewPgsqlConnectManager

func NewPgsqlConnectManager() ConnectManager

NewPgsqlConnectManager new a database manager

type Env

type Env struct {
	ConnectParams   interface{}
	MaxIdle         int
	MaxOpen         int
	ConnMaxLifetime time.Duration
}

Env database init params.

type MysqlConnectParams

type MysqlConnectParams struct {
	DBName         string
	User           string
	Password       string
	Addr           string
	Collation      string
	Charset        string
	Local          string
	ParseTime      bool
	ConnectTimeout string
	ReadTimeout    string
	WriteTimeout   string
	SSLMode        string
	SSLCert        string
	SSLKey         string
	SSLRootCert    string
}

MysqlConnectParams database init params.

type PgsqlConnectParams

type PgsqlConnectParams struct {
	DBName         string
	User           string
	Password       string
	Host           string
	Port           int
	SSLMode        string
	ConnectTimeout int
	SSLCert        string
	SSLKey         string
	SSLRootCert    string
}

PgsqlConnectParams database init params.

Jump to

Keyboard shortcuts

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