sqldb

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MysqlDriverName = "mysql"
View Source
const PostgresDriverName = "postgres"

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangelogSQLDB

type ChangelogSQLDB struct {
	// contains filtered or unexported fields
}

func NewChangelogSQLDB

func NewChangelogSQLDB(dbUrl string) (*ChangelogSQLDB, error)

func (*ChangelogSQLDB) Close

func (cdb *ChangelogSQLDB) Close() error

func (*ChangelogSQLDB) DeleteExpiredLock

func (cdb *ChangelogSQLDB) DeleteExpiredLock(timeoutInSecond int) error

type Database

type Database struct {
	DriverName string
	DSN        string
}

func GetConnection

func GetConnection(dbUrl string) (*Database, error)

*

This function is used to generate db connection info, for example,
For mysql:
input dbUrl: 'username:password@tcp(localhost:3306)/autoscaler?tls=custom&sslrootcert=db_ca.crt'
  return:
  &Database{DriverName: "mysql", DSN:"username:password@tcp(localhost:3306)/autoscaler?parseTime=true&tls=custom"}

For postgres:

  input dbUrl: postgres://postgres:password@localhost:5432/autoscaler?sslmode=disable
  return:
  &Database{DriverName: "postgres", DSN:"postgres://postgres:password@localhost:5432/autoscaler?sslmode=disable"
*

type MySQLConfig

type MySQLConfig struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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