本文整理匯總了Golang中github.com/outbrain/orchestrator/go/inst.BinlogCoordinates.PreviousFileCoordinates方法的典型用法代碼示例。如果您正苦於以下問題:Golang BinlogCoordinates.PreviousFileCoordinates方法的具體用法?Golang BinlogCoordinates.PreviousFileCoordinates怎麽用?Golang BinlogCoordinates.PreviousFileCoordinates使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/outbrain/orchestrator/go/inst.BinlogCoordinates
的用法示例。
在下文中一共展示了BinlogCoordinates.PreviousFileCoordinates方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestBinlogPrevious
func (s *TestSuite) TestBinlogPrevious(c *C) {
c1 := inst.BinlogCoordinates{LogFile: "mysql-bin.00017", LogPos: 104}
cres, err := c1.PreviousFileCoordinates()
c.Assert(err, IsNil)
c.Assert(c1.Type, Equals, cres.Type)
c.Assert(cres.LogFile, Equals, "mysql-bin.00016")
c2 := inst.BinlogCoordinates{LogFile: "mysql-bin.00100", LogPos: 104}
cres, err = c2.PreviousFileCoordinates()
c.Assert(err, IsNil)
c.Assert(c1.Type, Equals, cres.Type)
c.Assert(cres.LogFile, Equals, "mysql-bin.00099")
c3 := inst.BinlogCoordinates{LogFile: "mysql.00.prod.com.00100", LogPos: 104}
cres, err = c3.PreviousFileCoordinates()
c.Assert(err, IsNil)
c.Assert(c1.Type, Equals, cres.Type)
c.Assert(cres.LogFile, Equals, "mysql.00.prod.com.00099")
c4 := inst.BinlogCoordinates{LogFile: "mysql.00.prod.com.00000", LogPos: 104}
_, err = c4.PreviousFileCoordinates()
c.Assert(err, Not(IsNil))
}