当前位置: 首页>>代码示例>>Golang>>正文


Golang inst.BinlogCoordinates类代码示例

本文整理汇总了Golang中github.com/outbrain/orchestrator/go/inst.BinlogCoordinates的典型用法代码示例。如果您正苦于以下问题:Golang BinlogCoordinates类的具体用法?Golang BinlogCoordinates怎么用?Golang BinlogCoordinates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BinlogCoordinates类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: TestBinlogFileNumberDistance

func (s *TestSuite) TestBinlogFileNumberDistance(c *C) {
	c1 := inst.BinlogCoordinates{LogFile: "mysql-bin.00017", LogPos: 104}
	fileNum, numLen := c1.FileNumber()

	c.Assert(fileNum, Equals, 17)
	c.Assert(numLen, Equals, 5)
}
开发者ID:rlowe,项目名称:orchestrator,代码行数:7,代码来源:instance_test.go

示例2: TestBinlogFileNumber

func (s *TestSuite) TestBinlogFileNumber(c *C) {
	c1 := inst.BinlogCoordinates{LogFile: "mysql-bin.00017", LogPos: 104}
	c2 := inst.BinlogCoordinates{LogFile: "mysql-bin.00022", LogPos: 104}

	c.Assert(c1.FileNumberDistance(&c1), Equals, 0)
	c.Assert(c1.FileNumberDistance(&c2), Equals, 5)
	c.Assert(c2.FileNumberDistance(&c1), Equals, -5)
}
开发者ID:rlowe,项目名称:orchestrator,代码行数:8,代码来源:instance_test.go

示例3: 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))
}
开发者ID:ruo91,项目名称:orchestrator,代码行数:27,代码来源:instance_test.go

示例4: TestBinlogCoordinates

func (s *TestSuite) TestBinlogCoordinates(c *C) {
	c1 := inst.BinlogCoordinates{LogFile: "mysql-bin.00017", LogPos: 104}
	c2 := inst.BinlogCoordinates{LogFile: "mysql-bin.00017", LogPos: 104}
	c3 := inst.BinlogCoordinates{LogFile: "mysql-bin.00017", LogPos: 5000}
	c4 := inst.BinlogCoordinates{LogFile: "mysql-bin.00112", LogPos: 104}

	c.Assert(c1.Equals(&c2), Equals, true)
	c.Assert(c1.Equals(&c3), Equals, false)
	c.Assert(c1.Equals(&c4), Equals, false)
	c.Assert(c1.SmallerThan(&c2), Equals, false)
	c.Assert(c1.SmallerThan(&c3), Equals, true)
	c.Assert(c1.SmallerThan(&c4), Equals, true)
	c.Assert(c3.SmallerThan(&c4), Equals, true)
	c.Assert(c3.SmallerThan(&c2), Equals, false)
	c.Assert(c4.SmallerThan(&c2), Equals, false)
	c.Assert(c4.SmallerThan(&c3), Equals, false)
}
开发者ID:ruo91,项目名称:orchestrator,代码行数:17,代码来源:instance_test.go


注:本文中的github.com/outbrain/orchestrator/go/inst.BinlogCoordinates类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。