mysql

package
v0.0.1-dev Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() *sql.DB

Get returns the handler to operate mysql if success

func Valid

func Valid() bool

Valid returns a bool valud to determine whether the connection is ready to use

Types

type MySQL

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

func New

func New() *MySQL

func (MySQL) Category

func (m MySQL) Category() category.Category

func (*MySQL) Connect

func (m *MySQL) Connect() error

func (*MySQL) Destory

func (m *MySQL) Destory()

func (*MySQL) Load

func (m *MySQL) Load(src []byte) error

type Option

type Option struct {
	Address  string `json:"address"`
	DBName   string `json:"dbname"`
	Username string `json:"username"`
	Password string `json:"password"`
	Port     int    `json:"port"`

	// MaxOpenConns sets the maximum number of open connections to the database
	MaxOpenConns int `json:"max_open_conns"`
	// MaxIdleConns sets the maximum number of connections in the idle connection pool.
	MaxIdleConns int `json:"max_idle_conns"`
}

Jump to

Keyboard shortcuts

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