本文整理汇总了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))
}