mysql

package
v0.0.0-...-703489d Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RollbackTx

func RollbackTx(tx *sql.Tx, err error) error

RollbackTx will try to rollback the transaction and return an error message accordingly

Types

type DBConfig

type DBConfig struct {
	Username     string
	Password     string
	Host         string
	Port         string
	DatabaseName string
}

DBConfig is the configuration used to connection to database

func ConfigureDB

func ConfigureDB(userSecret, passSecret, hostSecret, dbPort, dbName string) (*DBConfig, error)

ConfigureDB reads the database user name and password from a file (secret) and creates a DBConfig that can be used to connect to the database.

func (DBConfig) Connect

func (c DBConfig) Connect() (*sql.DB, error)

func (DBConfig) TestConn

func (c DBConfig) TestConn() error

Jump to

Keyboard shortcuts

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