Documentation ¶
Overview ¶
dbhelper.go
Index ¶
- func CheckBinlogFilters(m *sqlx.DB, s *sqlx.DB) bool
- func CheckHostAddr(h string) (string, error)
- func CheckLongRunningWrites(db *sqlx.DB, thresh int) int
- func CheckReplicationFilters(m *sqlx.DB, s *sqlx.DB) bool
- func CheckSlavePrerequisites(db *sqlx.DB, s string) bool
- func CheckSlaveSync(dbS *sqlx.DB, dbM *sqlx.DB) bool
- func Connect(user string, password string, address string) *sqlx.DB
- func FlushTablesNoLog(db *sqlx.DB) error
- func FlushTablesWithReadLock(db *sqlx.DB) error
- func GetAddress(host string, port string, socket string) string
- func GetSlaveHosts(db *sqlx.DB) map[string]interface{}
- func GetSlaveHostsDiscovery(db *sqlx.DB) []string
- func GetStatus(db *sqlx.DB) map[string]string
- func GetStatusAsInt(db *sqlx.DB) map[string]int64
- func GetVariableByName(db *sqlx.DB, name string) string
- func GetVariables(db *sqlx.DB) map[string]string
- func IsSlaveof(db *sqlx.DB, s string, m string) bool
- func MasterPosWait(db *sqlx.DB, gtid string) error
- func MySQLConnect(user string, password string, address string) (*sqlx.DB, error)
- func ResetSlave(db *sqlx.DB, all bool) error
- func SetReadOnly(db *sqlx.DB, flag bool) error
- func StartSlave(db *sqlx.DB) error
- func StopSlave(db *sqlx.DB) error
- func UnlockTables(db *sqlx.DB) error
- type MasterStatus
- type Processlist
- type SlaveHosts
- type SlaveStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckHostAddr ¶
Check if string is an IP address or a hostname, return a IP address
func CheckSlavePrerequisites ¶
Check for a list of slave prerequisites.
- Slave is connected - Binary log on - Connected to master - No replication filters
func CheckSlaveSync ¶
Check if a slave is in sync with his master
func FlushTablesNoLog ¶
func FlushTablesWithReadLock ¶
func GetSlaveHosts ¶
func GetSlaveHostsDiscovery ¶
func MySQLConnect ¶
func StartSlave ¶
func UnlockTables ¶
Types ¶
type MasterStatus ¶
type MasterStatus struct { File string Position string Binlog_Do_DB string Binlog_Ignore_DB string }
func GetMasterStatus ¶
func GetMasterStatus(db *sqlx.DB) (MasterStatus, error)
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
type SlaveHosts ¶
func GetSlaveHostsArray ¶
func GetSlaveHostsArray(db *sqlx.DB) []SlaveHosts
type SlaveStatus ¶
type SlaveStatus struct { Slave_IO_State string Master_Host string Master_User string Master_Port uint Connect_Retry uint Master_Log_File string Read_Master_Log_Pos uint Relay_Log_File string Relay_Log_Pos uint Relay_Master_Log_File string Slave_IO_Running string Slave_SQL_Running string Replicate_Do_DB string Replicate_Ignore_DB string Replicate_Do_Table string Replicate_Ignore_Table string Replicate_Wild_Do_Table string Replicate_Wild_Ignore_Table string Last_Errno uint Last_Error string Skip_Counter uint Exec_Master_Log_Pos uint Relay_Log_Space uint Until_Condition string Until_Log_File string Until_Log_Pos uint Master_SSL_Allowed string Master_SSL_CA_File string Master_SSL_CA_Path string Master_SSL_Cert string Master_SSL_Cipher string Master_SSL_Key string Seconds_Behind_Master sql.NullInt64 Master_SSL_Verify_Server_Cert string Last_IO_Errno uint Last_IO_Error string Last_SQL_Errno uint Last_SQL_Error string Replicate_Ignore_Server_Ids string Master_Server_Id uint Master_SSL_Crl string Master_SSL_Crlpath string Using_Gtid string Gtid_IO_Pos string }
func GetSlaveStatus ¶
func GetSlaveStatus(db *sqlx.DB) (SlaveStatus, error)
Click to show internal directories.
Click to hide internal directories.