mysql

package
v0.0.0-...-52b781a Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MysqlClient

type MysqlClient struct {
	LatencyChan    chan *time.Duration
	ErrLatencyChan chan *time.Duration

	Addr         string
	Password     string
	User         string
	DB           string
	Client       *sql.DB
	SessionCount int
	Complexity   int
	Sql          string
	// contains filtered or unexported fields
}

func (*MysqlClient) Close

func (mc *MysqlClient) Close()

func (*MysqlClient) Exec

func (mc *MysqlClient) Exec() error

func (*MysqlClient) InitClient

func (mc *MysqlClient) InitClient()

InitClient 初始化MySQL客户端连接。 此方法会首先尝试创建数据库(如果不存在),然后创建数据库连接,并设置最大连接数和最大空闲连接数。 还会执行一个查询SQL来准备客户端操作。

func (*MysqlClient) IsReady

func (mc *MysqlClient) IsReady() bool

func (*MysqlClient) Property

func (mc *MysqlClient) Property()

func (*MysqlClient) QueryTest

func (mc *MysqlClient) QueryTest() error

QueryTest 是 MysqlClient 类的一个方法,用于并发执行查询操作,并统计每个查询的延迟时间。 该方法不接受参数,返回可能发生的错误。

Jump to

Keyboard shortcuts

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