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


Golang ServiceClient.Cells方法代码示例

本文整理汇总了Golang中github.com/cloudfoundry-incubator/bbs.ServiceClient.Cells方法的典型用法代码示例。如果您正苦于以下问题:Golang ServiceClient.Cells方法的具体用法?Golang ServiceClient.Cells怎么用?Golang ServiceClient.Cells使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/cloudfoundry-incubator/bbs.ServiceClient的用法示例。


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

示例1:

						ghttp.RespondWithJSONEncoded(http.StatusOK, &struct{}{})),
				)
			})

			It("destroys any existing containers", func() {
				Eventually(deleteChan).Should(Receive())
				Eventually(deleteChan).Should(Receive())
			})
		})

		Describe("maintaining presence", func() {
			var cellPresence *models.CellPresence

			JustBeforeEach(func() {
				Eventually(fetchCells(logger, serviceClient)).Should(HaveLen(1))
				cells, err := serviceClient.Cells(logger)
				Expect(err).NotTo(HaveOccurred())
				cellPresence = cells[cellID]
			})

			It("should maintain presence", func() {
				Expect(cellPresence.CellID).To(Equal(cellID))
				expectedRootFSProviders := map[string][]string{
					"docker":    []string{},
					"preloaded": []string{"the-rootfs"},
				}
				Expect(cellPresence.RootFSProviders).To(Equal(expectedRootFSProviders))
			})

			It("should have no session health checks", func() {
				sessions, _, err := consulRunner.NewClient().Session().List(nil)
开发者ID:emc-xchallenge,项目名称:rep,代码行数:31,代码来源:main_test.go

示例2: fetchCells

func fetchCells(logger lager.Logger, serviceClient bbs.ServiceClient) func() (models.CellSet, error) {
	return func() (models.CellSet, error) {
		return serviceClient.Cells(logger)
	}
}
开发者ID:emc-xchallenge,项目名称:rep,代码行数:5,代码来源:main_test.go

示例3:

				Expect(err).To(HaveOccurred())
				modelErr := models.ConvertError(err)
				Expect(modelErr.Type).To(Equal(models.Error_ResourceNotFound))
			})
		})
	})

	Describe("Cells", func() {
		const cell1 = "cell-id-1"
		const cell2 = "cell-id-2"

		Context("when there is a single cell", func() {
			var maintainers ifrit.Process

			BeforeEach(func() {
				Expect(serviceClient.Cells(logger)).To(HaveLen(0))
				maintainers = ifrit.Invoke(grouper.NewParallel(os.Interrupt, grouper.Members{
					{cell1, serviceClient.NewCellPresenceRunner(logger, newCellPresence(cell1), locket.LockTTL)},
					{cell2, serviceClient.NewCellPresenceRunner(logger, newCellPresence(cell2), locket.LockTTL)},
				}))
			})

			AfterEach(func() {
				ginkgomon.Interrupt(maintainers)
			})

			It("returns only one cell", func() {
				Eventually(func() (models.CellSet, error) { return serviceClient.Cells(logger) }).Should(HaveLen(2))
				Expect(serviceClient.Cells(logger)).To(HaveKey(cell1))
				Expect(serviceClient.Cells(logger)).To(HaveKey(cell2))
			})
开发者ID:emc-xchallenge,项目名称:bbs,代码行数:31,代码来源:service_client_test.go


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