db

package
v0.0.0-...-68a5074 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBUser       = "brucewayne"
	DBPass       = "batman"
	DBName       = "demo"
	DBCollection = "sample"
)

Shared config.

View Source
const (
	MySQL = "mysql"
)

All dependencies.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMySQL

type ConfigMySQL struct {
	User string
	Pass string
	DB   string
	Host string
	Port string
}

func (*ConfigMySQL) DataSourceName

func (c *ConfigMySQL) DataSourceName() string

DataSourceName returns a connection string suitable for sql.Open.

func (*ConfigMySQL) New

func (c *ConfigMySQL) New() (*sql.DB, error)

New returns a new mysql connection.

func (*ConfigMySQL) SetupConfig

func (c *ConfigMySQL) SetupConfig() error

SetupConfig populates mysql config using environment variables.

Jump to

Keyboard shortcuts

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