mysql

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client added in v0.0.6

func Client() *sql.DB

Client returns the handler to operate mysql if success

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) Connect

func (m *MySQL) Connect() error

func (*MySQL) Destory

func (m *MySQL) Destory()

func (*MySQL) Load

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

func (MySQL) Name added in v0.0.6

func (m MySQL) Name() string

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