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


Golang Client.DeleteDesiredLRP方法代码示例

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


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

示例1: handleDelete

func handleDelete(receptorClient receptor.Client) {
	if *processGuid == "" {
		logger.Fatal("missing-processGuid", errors.New("Missing mandatory processGuid parameter for delete action"))
	}

	err := receptorClient.DeleteDesiredLRP(*processGuid)
	if err != nil {
		logger.Error("failed-to-delete", err, lager.Data{"process-guid": *processGuid})
		return
	}
	fmt.Printf("Desired LRP successfully deleted for process guid %s\n", *processGuid)
}
开发者ID:davidwadden,项目名称:cf-tcp-router-acceptance-tests,代码行数:12,代码来源:main.go

示例2:

			receptorClient = receptor.NewClient(routerApiConfig.DiegoAPIURL)

			externalPort = 62000 + GinkgoParallelNode()
			sampleReceiverPort1 = 8000 + GinkgoParallelNode()
			serverId1 = fmt.Sprintf("serverId-%d", GinkgoParallelNode())

			lrp := helpers.CreateDesiredLRP(logger,
				uint16(externalPort), uint16(sampleReceiverPort1), serverId1, 1)

			err := receptorClient.CreateDesiredLRP(lrp)
			Expect(err).ShouldNot(HaveOccurred())
			processGuid = lrp.ProcessGuid
		})

		AfterEach(func() {
			err := receptorClient.DeleteDesiredLRP(processGuid)
			Expect(err).ShouldNot(HaveOccurred())
		})

		It("receives TCP traffic on desired external port", func() {
			verifyConnection(externalPort, serverId1)

			By("updating LRP with new external port it receives traffic on new external port")
			externalPort = 63000 + GinkgoParallelNode()
			updatedLrp := helpers.UpdateDesiredLRP(uint16(externalPort),
				uint16(sampleReceiverPort1), 1)
			err := receptorClient.UpdateDesiredLRP(processGuid, updatedLrp)
			Expect(err).ShouldNot(HaveOccurred())
			verifyConnection(externalPort, serverId1)
		})
	})
开发者ID:davidwadden,项目名称:cf-tcp-router-acceptance-tests,代码行数:31,代码来源:router_test.go


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