本文整理匯總了Golang中github.com/youtube/vitess/go/vt/mysqlctl/proto.ReplicationStatus.MasterPort方法的典型用法代碼示例。如果您正苦於以下問題:Golang ReplicationStatus.MasterPort方法的具體用法?Golang ReplicationStatus.MasterPort怎麽用?Golang ReplicationStatus.MasterPort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/youtube/vitess/go/vt/mysqlctl/proto.ReplicationStatus
的用法示例。
在下文中一共展示了ReplicationStatus.MasterPort方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: parseSlaveStatus
// parseSlaveStatus parses the common fields of SHOW SLAVE STATUS.
func parseSlaveStatus(fields map[string]string) proto.ReplicationStatus {
status := proto.ReplicationStatus{
MasterHost: fields["Master_Host"],
SlaveIORunning: fields["Slave_IO_Running"] == "Yes",
SlaveSQLRunning: fields["Slave_SQL_Running"] == "Yes",
}
parseInt, _ := strconv.ParseInt(fields["Master_Port"], 10, 0)
status.MasterPort = int(parseInt)
parseInt, _ = strconv.ParseInt(fields["Connect_Retry"], 10, 0)
status.MasterConnectRetry = int(parseInt)
parseUint, _ := strconv.ParseUint(fields["Seconds_Behind_Master"], 10, 0)
status.SecondsBehindMaster = uint(parseUint)
return status
}