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


Golang PipelineDB.Pause方法代码示例

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


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

示例1: PausePipeline

func (s *Server) PausePipeline(pipelineDB db.PipelineDB) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		err := pipelineDB.Pause()
		if err != nil {
			w.WriteHeader(http.StatusInternalServerError)
			return
		}

		w.WriteHeader(http.StatusOK)
	})
}
开发者ID:utako,项目名称:atc,代码行数:11,代码来源:pause.go

示例2: PausePipeline

func (s *Server) PausePipeline(pipelineDB db.PipelineDB) http.Handler {
	logger := s.logger.Session("pause-pipeline")
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		err := pipelineDB.Pause()
		if err != nil {
			logger.Error("failed-to-pause-pipeline", err)
			w.WriteHeader(http.StatusInternalServerError)
			return
		}

		w.WriteHeader(http.StatusOK)
	})
}
开发者ID:ACPK,项目名称:atc,代码行数:13,代码来源:pause.go

示例3:

				Expect(page.Navigate(homepage())).To(Succeed())
				Eventually(page.Find(".job.paused")).Should(BeFound())

				// job-detail unpausing
				Expect(page.Navigate(withPath("/jobs/job-name"))).To(Succeed())
				Eventually(page.Find("#job-state.btn-pause")).Should(BeFound())
				Expect(page.Find("#job-state.btn-pause").Click()).To(Succeed())
				Eventually(page.Find("#job-state.btn-pause.disabled")).Should(BeFound())
				Eventually(page.Find("#job-state.btn-pause.enabled")).ShouldNot(BeFound())
			})

			Describe("paused pipeline", func() {
				BeforeEach(func() {
					pipelineDB, err := pipelineDBFactory.BuildWithTeamNameAndName(atc.DefaultTeamName, atc.DefaultPipelineName)
					Expect(err).NotTo(HaveOccurred())
					err = pipelineDB.Pause()
					Expect(err).NotTo(HaveOccurred())
				})

				It("displays a blue header", func() {
					// homepage -> job detail w/build info
					Expect(page.Navigate(homepage())).To(Succeed())
					// we will need to authenticate later to prove it is working for our page
					Authenticate(page, "admin", "password")

					Expect(page.Navigate(withPath("jobs/job-name"))).To(Succeed())

					// top bar should show the pipeline is paused
					Eventually(page.Find(".js-groups.paused")).Should(BeFound())
				})
			})
开发者ID:pcfdev-forks,项目名称:atc,代码行数:31,代码来源:job_pausing_test.go


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