mysql

package
v0.0.0-...-4b64205 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB *sql.DB
)

Functions

func New

func New(config Config) error

New init databases connections and panic if failed to connect

Types

type Config

type Config struct {
	Host        string `json:"host"`
	Port        int    `json:"port"`
	User        string `json:"user"`
	Password    string `json:"password"`
	DBName      string `json:"db_name"`
	Params      string `json:"params"`
	MaxLifetime int    `json:"max_lifetime"`
	PoolSize    int    `json:"pool_size"`
}

Config databases

func (Config) DSN

func (s Config) DSN() string

DSN return data source name to connect mysql

Jump to

Keyboard shortcuts

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