mysql

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: Apache-2.0 Imports: 3 Imported by: 7

Documentation

Index

Constants

View Source
const (
	DefaultCharSet     = "utf8mb4"
	ReplicationMaster  = "master"
	ReplicationSlave   = "slave"
	ReplicationRelay   = "relay" // it has master and slave roles at the same time
	HostString         = "host"
	PortString         = "port"
	ShowSlaveStatusSQL = "show slave status"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	Addr   string
	DBName string
	DBUser string
	DBPass string
	client.Conn
}

func NewMySQLConn

func NewMySQLConn(addr string, dbName string, dbUser string, dbPass string) (*Conn, error)

NewMySQLConn returns connection to mysql database, be aware that addr is host:port style, default charset is utf8mb4

func (*Conn) GetReplicationRole

func (conn *Conn) GetReplicationRole() (role string, err error)

func (*Conn) GetReplicationSlaveList

func (conn *Conn) GetReplicationSlaveList() (slaveList []string, err error)

func (*Conn) GetReplicationSlavesStatus

func (conn *Conn) GetReplicationSlavesStatus() (result *mysql.Result, err error)

Jump to

Keyboard shortcuts

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