Documentation ¶
Index ¶
- func BenchCleanup(db *sqlx.DB) error
- func ChangeMaster(db *sqlx.DB, opt ChangeMasterOpt) error
- func CheckBinlogFilters(m *sqlx.DB, s *sqlx.DB) (bool, error)
- func CheckHostAddr(h string) (string, error)
- func CheckLongRunningWrites(db *sqlx.DB, thresh int) int
- func CheckReplicationAccount(db *sqlx.DB, pass string, user string, host string, ip string) (bool, error)
- func CheckReplicationFilters(m *sqlx.DB, s *sqlx.DB) bool
- func CheckSlavePrerequisites(db *sqlx.DB, s string) bool
- func CheckSlaveSemiSync(dbS *sqlx.DB) bool
- func CheckSlaveSync(dbS *sqlx.DB, dbM *sqlx.DB) bool
- func ChecksumTable(db *sqlx.DB, table string) (string, error)
- func FlushLogs(db *sqlx.DB) error
- func FlushTables(db *sqlx.DB) error
- func FlushTablesNoLog(db *sqlx.DB) error
- func FlushTablesWithReadLock(db *sqlx.DB) error
- func ForgetArbitration(db *sqlx.DB, secret string) error
- func GetAddress(host string, port string, socket string) string
- func GetArbitrationMaster(db *sqlx.DB, secret string, cluster string) string
- func GetBinlogEventPseudoGTID(db *sqlx.DB, uuid string, lastfile string) (string, string, error)
- func GetBinlogPosAfterSkipNumberOfEvents(db *sqlx.DB, file string, pos string, skip int) (string, string, error)
- func GetEngineInnoDB(db *sqlx.DB) (map[string]string, error)
- func GetEventScheduler(dbM *sqlx.DB) bool
- func GetHostFromConnection(db *sqlx.DB, user string) (string, error)
- func GetHostFromProcessList(db *sqlx.DB, user string) string
- func GetLastPseudoGTID(db *sqlx.DB) (string, error)
- func GetMaxscaleVersion(db *sqlx.DB) (string, error)
- func GetNumberOfEventsAfterPos(db *sqlx.DB, lastfile string, lastpos string) (int, error)
- func GetProxySQLUsers(db *sqlx.DB) (map[string]Grant, error)
- func GetQueries(db *sqlx.DB) (map[string]string, error)
- func GetSchemas(db *sqlx.DB) ([]string, error)
- func GetSlaveHosts(db *sqlx.DB) (map[string]interface{}, error)
- func GetSlaveHostsDiscovery(db *sqlx.DB) ([]string, error)
- func GetSpiderMonitor(db *sqlx.DB) (string, error)
- func GetSpiderShardUrl(db *sqlx.DB) (string, error)
- func GetSpiderTableToSync(db *sqlx.DB) (map[string]SpiderTableNoSync, error)
- func GetStatus(db *sqlx.DB) (map[string]string, error)
- func GetStatusAsInt(db *sqlx.DB) (map[string]int64, error)
- func GetTables(db *sqlx.DB) (map[string]Table, error)
- func GetUsers(db *sqlx.DB) (map[string]Grant, error)
- func GetVariableByName(db *sqlx.DB, name string) (string, error)
- func GetVariableSource(db *sqlx.DB) string
- func GetVariables(db *sqlx.DB) (map[string]string, error)
- func HasMySQLGTID(db *sqlx.DB) (bool, error)
- func HaveExtraEvents(db *sqlx.DB, file string, pos string) (bool, error)
- func InjectLongTrx(db *sqlx.DB, time int) error
- func InjectTrx(db *sqlx.DB) error
- func InjectTrxWithoutCommit(db *sqlx.DB) error
- func InstallSemiSync(db *sqlx.DB) error
- func IsSlaveof(db *sqlx.DB, s string, m string, p string) (bool, error)
- func KillThreads(db *sqlx.DB)
- func MariaDBFlushTablesNoLogTimeout(db *sqlx.DB, timeout string) error
- func MariaDBVersion(server string) int
- func MasterPosWait(db *sqlx.DB, log string, pos string, timeout int) error
- func MasterWaitGTID(db *sqlx.DB, gtid string, timeout int) error
- func MySQLConnect(user string, password string, address string, parameters ...string) (*sqlx.DB, error)
- func RequestArbitration(db *sqlx.DB, uuid string, secret string, cluster string, master string, ...) bool
- func ResetAllSlaves(db *sqlx.DB) error
- func ResetMaster(db *sqlx.DB) error
- func ResetSlave(db *sqlx.DB, all bool) error
- func SQLiteConnect(path string) (*sqlx.DB, error)
- func SetBinlogAnnotate(db *sqlx.DB) error
- func SetBinlogChecksum(db *sqlx.DB) error
- func SetBinlogCompress(db *sqlx.DB) error
- func SetBinlogFormat(db *sqlx.DB, format string) error
- func SetBinlogSlowqueries(db *sqlx.DB) error
- func SetDefaultMasterConn(db *sqlx.DB, dmc string) error
- func SetEventScheduler(db *sqlx.DB, state bool) error
- func SetEventStatus(db *sqlx.DB, ev Event, status int64) error
- func SetHeartbeatTable(db *sqlx.DB) error
- func SetMultiSourceRepl(db *sqlx.DB, master_host string, master_port string, master_user string, ...) error
- func SetReadOnly(db *sqlx.DB, flag bool) error
- func SetRelayLogSpaceLimit(db *sqlx.DB, size string) error
- func SetSlaveGTIDMode(db *sqlx.DB, mode string) error
- func SetSlaveHeartbeat(db *sqlx.DB, interval string) error
- func SetStatusActiveHeartbeat(db *sqlx.DB, uuid string, status string, master string, secret string, uid int) error
- func SetSuperReadOnly(db *sqlx.DB, flag bool) error
- func SetSyncBinlog(db *sqlx.DB) error
- func SetSyncInnodb(db *sqlx.DB) error
- func StartSlave(db *sqlx.DB) error
- func StopAllSlaves(db *sqlx.DB) error
- func StopSlave(db *sqlx.DB) error
- func StopSlaveIOThread(db *sqlx.DB) error
- func StopSlaveSQLThread(db *sqlx.DB) error
- func UnlockTables(db *sqlx.DB) error
- func WriteConcurrent2(dsn string, qt int) (string, error)
- func WriteHeartbeat(db *sqlx.DB, uuid string, secret string, cluster string, master string, ...) error
- type BenchmarkSuite
- type BinlogEvents
- type ChangeMasterOpt
- type Event
- type Grant
- type MasterStatus
- type MySQLVersion
- type Privileges
- type Processlist
- type Result
- type SlaveHosts
- type SlaveStatus
- type SpiderTableNoSync
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BenchCleanup ¶
func ChangeMaster ¶
func ChangeMaster(db *sqlx.DB, opt ChangeMasterOpt) error
func CheckHostAddr ¶
Check if string is an IP address or a hostname, return a IP address
func CheckReplicationAccount ¶
func CheckSlavePrerequisites ¶
Check for a list of slave prerequisites.
- Slave is connected - Binary log on - Connected to master - No replication filters
func CheckSlaveSemiSync ¶
func CheckSlaveSync ¶
Check if a slave is in sync with his master
func FlushTables ¶
func FlushTablesNoLog ¶
func FlushTablesWithReadLock ¶
func GetArbitrationMaster ¶
func GetEventScheduler ¶
func GetSpiderTableToSync ¶
func GetSpiderTableToSync(db *sqlx.DB) (map[string]SpiderTableNoSync, error)
func GetVariableSource ¶
func InjectTrxWithoutCommit ¶
func InstallSemiSync ¶
func KillThreads ¶
func MariaDBVersion ¶
func MySQLConnect ¶
func RequestArbitration ¶
func ResetAllSlaves ¶
func ResetMaster ¶
func SQLiteConnect ¶
SQLiteConnect returns a SQLite connection
func SetBinlogAnnotate ¶
func SetBinlogChecksum ¶
SetBinlogChecksum Enable binlog checksum and check on master
func SetBinlogCompress ¶
SetBinlogCompress Enable MaraiDB 10.2 binlog compression
func SetBinlogSlowqueries ¶
SetBinlogSlowqueries Enable queries in replication to be reported in slow queries
func SetHeartbeatTable ¶
func SetMultiSourceRepl ¶
func SetStatusActiveHeartbeat ¶
func SetStatusActiveHeartbeat(db *sqlx.DB, uuid string, status string, master string, secret string, uid int) error
SetStatusActiveHeartbeat arbitrator can set or remove election flag "E"
func StartSlave ¶
func StopAllSlaves ¶
func StopSlaveIOThread ¶
func StopSlaveSQLThread ¶
func UnlockTables ¶
Types ¶
type BenchmarkSuite ¶
type BenchmarkSuite struct { WarmUp func(*sqlx.DB) error Repetitions int PrintStats bool // contains filtered or unexported fields }
func (*BenchmarkSuite) AddBenchmark ¶
func (*BenchmarkSuite) AddDriver ¶
func (bs *BenchmarkSuite) AddDriver(name, drv, dsn string) error
func (*BenchmarkSuite) Run ¶
func (bs *BenchmarkSuite) Run() string
type BinlogEvents ¶
type ChangeMasterOpt ¶
type MasterStatus ¶
func GetMasterStatus ¶
func GetMasterStatus(db *sqlx.DB) (MasterStatus, error)
type MySQLVersion ¶
func GetDBVersion ¶
func GetDBVersion(db *sqlx.DB) (*MySQLVersion, error)
func NewMySQLVersion ¶
func NewMySQLVersion(version string, versionComment string) *MySQLVersion
func (*MySQLVersion) IsMariaDB ¶
func (mv *MySQLVersion) IsMariaDB() bool
func (*MySQLVersion) IsMySQL ¶
func (mv *MySQLVersion) IsMySQL() bool
func (*MySQLVersion) IsMySQL57 ¶
func (mv *MySQLVersion) IsMySQL57() bool
func (*MySQLVersion) IsMySQLOrPercona ¶
func (mv *MySQLVersion) IsMySQLOrPercona() bool
func (*MySQLVersion) IsMySQLOrPercona57 ¶
func (mv *MySQLVersion) IsMySQLOrPercona57() bool
func (*MySQLVersion) IsPercona ¶
func (mv *MySQLVersion) IsPercona() bool
type Privileges ¶
type Privileges struct { Select_priv string Process_priv string Super_priv string Repl_slave_priv string Repl_client_priv string Reload_priv string }
func GetPrivileges ¶
type Processlist ¶
type Processlist struct { Id uint64 User string Host string Database sql.NullString Command string Time float64 State string }
func GetProcesslist ¶
func GetProcesslist(db *sqlx.DB) ([]Processlist, error)
type Result ¶
func (*Result) AllocsPerQuery ¶
func (*Result) BytesPerQuery ¶
func (*Result) QueriesPerSecond ¶
type SlaveHosts ¶
func GetSlaveHostsArray ¶
func GetSlaveHostsArray(db *sqlx.DB) ([]SlaveHosts, error)
type SlaveStatus ¶
type SlaveStatus struct { ConnectionName sql.NullString `db:"Connection_Name"` MasterHost sql.NullString `db:"Master_Host"` MasterUser sql.NullString `db:"Master_User"` MasterPort sql.NullString `db:"Master_Port"` MasterLogFile sql.NullString `db:"Master_Log_File"` ReadMasterLogPos sql.NullString `db:"Read_Master_Log_Pos"` RelayMasterLogFile sql.NullString `db:"Relay_Master_Log_File"` SlaveIORunning sql.NullString `db:"Slave_IO_Running"` SlaveSQLRunning sql.NullString `db:"Slave_SQL_Running"` ExecMasterLogPos sql.NullString `db:"Exec_Master_Log_Pos"` SecondsBehindMaster sql.NullInt64 `db:"Seconds_Behind_Master"` LastIOErrno sql.NullString `db:"Last_IO_Errno"` LastIOError sql.NullString `db:"Last_IO_Error"` LastSQLErrno sql.NullString `db:"Last_SQL_Errno"` LastSQLError sql.NullString `db:"Last_SQL_Error"` MasterServerID uint `db:"Master_Server_Id"` UsingGtid sql.NullString `db:"Using_Gtid"` GtidIOPos sql.NullString `db:"Gtid_IO_Pos"` GtidSlavePos sql.NullString `db:"Gtid_Slave_Pos"` SlaveHeartbeatPeriod float64 `db:"Slave_Heartbeat_Period"` ExecutedGtidSet sql.NullString `db:"Executed_Gtid_Set"` RetrievedGtidSet sql.NullString `db:"Retrieved_Gtid_Set"` SlaveSQLRunningState sql.NullString `db:"Slave_SQL_Running_State"` }
func GetAllSlavesStatus ¶
func GetAllSlavesStatus(db *sqlx.DB) ([]SlaveStatus, error)
func GetChannelSlaveStatus ¶
func GetChannelSlaveStatus(db *sqlx.DB) ([]SlaveStatus, error)
func GetMSlaveStatus ¶
func GetMSlaveStatus(db *sqlx.DB, conn string) (SlaveStatus, error)
func GetSlaveStatus ¶
func GetSlaveStatus(db *sqlx.DB) (SlaveStatus, error)
type SpiderTableNoSync ¶
Click to show internal directories.
Click to hide internal directories.