當前位置: 首頁>>代碼示例>>Golang>>正文


Golang colors.PurpleUnderline函數代碼示例

本文整理匯總了Golang中github.com/cloudfoundry-incubator/ltc/terminal/colors.PurpleUnderline函數的典型用法代碼示例。如果您正苦於以下問題:Golang PurpleUnderline函數的具體用法?Golang PurpleUnderline怎麽用?Golang PurpleUnderline使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了PurpleUnderline函數的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: removeApp

func (runner *clusterTestRunner) removeApp(timeout time.Duration, appName string, args ...string) {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline(fmt.Sprintf("Attempting to remove app %s", appName)))

	command := runner.command("remove", appName)
	session, err := gexec.Start(command, getStyledWriter("remove"), getStyledWriter("remove"))
	Expect(err).NotTo(HaveOccurred())

	expectExit(timeout, session)
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:9,代碼來源:cluster_test_runner.go

示例2: streamDebugLogs

func (runner *clusterTestRunner) streamDebugLogs(timeout time.Duration, args ...string) *gexec.Session {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline("Attempting to stream cluster debug logs"))

	command := runner.command("debug-logs")
	session, err := gexec.Start(command, getStyledWriter("debug"), getStyledWriter("debug"))
	Expect(err).NotTo(HaveOccurred())

	return session
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:9,代碼來源:cluster_test_runner.go

示例3: streamLogs

func (runner *clusterTestRunner) streamLogs(timeout time.Duration, appName string, args ...string) *gexec.Session {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline(fmt.Sprintf("Attempting to stream logs from %s", appName)))

	command := runner.command("logs", appName)
	session, err := gexec.Start(command, getStyledWriter("logs"), getStyledWriter("logs"))
	Expect(err).NotTo(HaveOccurred())

	return session
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:9,代碼來源:cluster_test_runner.go

示例4: scaleApp

func (runner *clusterTestRunner) scaleApp(timeout time.Duration, appName string, args ...string) {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline(fmt.Sprintf("Attempting to scale %s", appName)))

	command := runner.command("scale", appName, "3")
	session, err := gexec.Start(command, getStyledWriter("scale"), getStyledWriter("scale"))
	Expect(err).NotTo(HaveOccurred())

	expectExit(timeout, session)
	Expect(session.Out).To(gbytes.Say("App Scaled Successfully"))
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:10,代碼來源:cluster_test_runner.go

示例5: launchDroplet

func (runner *clusterTestRunner) launchDroplet(timeout time.Duration, appName, dropletName string, args ...string) {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline(fmt.Sprintf("Launching droplet %s as %s", dropletName, appName)))

	launchArgs := append([]string{"launch-droplet", appName, dropletName}, args...)
	command := runner.command(launchArgs...)
	session, err := gexec.Start(command, getStyledWriter("launch-droplet"), getStyledWriter("launch-droplet"))
	Expect(err).NotTo(HaveOccurred())

	expectExit(timeout, session)
	Expect(session.Out).To(gbytes.Say(appName + " is now running."))
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:11,代碼來源:cluster_test_runner.go

示例6: removeDroplet

func (runner *clusterTestRunner) removeDroplet(timeout time.Duration, dropletName string) {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline(fmt.Sprintf("Attempting to remove droplet %s", dropletName)))

	command := runner.command("remove-droplet", dropletName)
	session, err := gexec.Start(command, getStyledWriter("remove-droplet"), getStyledWriter("remove-droplet"))
	Expect(err).NotTo(HaveOccurred())

	expectExit(timeout, session)
	Expect(session.Out).To(gbytes.Say("Droplet removed"))

	fmt.Fprintln(getStyledWriter("test"), "Removed", dropletName)
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:12,代碼來源:cluster_test_runner.go

示例7: listDroplets

func (runner *clusterTestRunner) listDroplets(timeout time.Duration, dropletName string) {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline("Attempting to find droplet in the list"))

	command := runner.command("list-droplets")
	session, err := gexec.Start(command, getStyledWriter("list-droplets"), getStyledWriter("list-droplets"))
	Expect(err).NotTo(HaveOccurred())

	expectExit(timeout, session)
	Expect(session.Out).To(gbytes.Say(dropletName))

	fmt.Fprintln(getStyledWriter("test"), "Found", dropletName, "in the list!")
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:12,代碼來源:cluster_test_runner.go

示例8: buildDroplet

func (runner *clusterTestRunner) buildDroplet(timeout time.Duration, dropletName, buildpack, srcDir string) {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline(fmt.Sprintf("Submitting build of %s with buildpack %s", dropletName, buildpack)))

	command := runner.command("build-droplet", dropletName, buildpack, "--timeout", timeout.String())
	command.Dir = srcDir
	session, err := gexec.Start(command, getStyledWriter("build-droplet"), getStyledWriter("build-droplet"))
	Expect(err).NotTo(HaveOccurred())

	expectExit(timeout, session)
	Expect(session.Out).To(gbytes.Say("Submitted build of " + dropletName))
	Expect(session.Out).NotTo(gbytes.Say("use of closed network connection"))
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:12,代碼來源:cluster_test_runner.go

示例9: updateApp

func (runner *clusterTestRunner) updateApp(timeout time.Duration, appName string, args ...string) {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline(fmt.Sprintf("Attempting to update %s", appName)))
	updateArgs := append([]string{"update", appName}, args...)
	command := runner.command(updateArgs...)

	session, err := gexec.Start(command, getStyledWriter("update"), getStyledWriter("update"))

	Expect(err).NotTo(HaveOccurred())
	expectExit(timeout, session)

	Expect(session.Out).To(gbytes.Say("Updating " + appName + " routes"))
	fmt.Fprintln(getStyledWriter("test"), "Yay! updated", appName)
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:13,代碼來源:cluster_test_runner.go

示例10: createDockerApp

func (runner *clusterTestRunner) createDockerApp(timeout time.Duration, appName, dockerPath string, args ...string) {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline(fmt.Sprintf("Attempting to create %s", appName)))

	createArgs := append([]string{"create", appName, dockerPath}, args...)
	command := runner.command(createArgs...)
	session, err := gexec.Start(command, getStyledWriter("create"), getStyledWriter("create"))
	Expect(err).NotTo(HaveOccurred())

	expectExit(timeout, session)
	Expect(session.Out).To(gbytes.Say(appName + " is now running."))

	fmt.Fprintln(getStyledWriter("test"), "Yay! Created", appName)
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:13,代碼來源:cluster_test_runner.go

示例11: checkIfTaskCompleted

func (runner *clusterTestRunner) checkIfTaskCompleted(taskName string) func() bool {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline("Waiting for task "+taskName+" to complete"))
	return func() bool {
		command := runner.command("task", taskName)

		session, err := gexec.Start(command, getStyledWriter("task"), getStyledWriter("task"))
		if err != nil {
			panic(err)
		}
		if exitCode := session.Wait().ExitCode(); exitCode != 0 {
			return true
		}

		return bytes.Contains(session.Out.Contents(), []byte("COMPLETED"))
	}
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:16,代碼來源:cluster_test_runner.go

示例12: cloneRepo

func (runner *clusterTestRunner) cloneRepo(timeout time.Duration, repoURL string) string {
	tmpDir, err := ioutil.TempDir("", "repo")
	Expect(err).NotTo(HaveOccurred())

	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline(fmt.Sprintf("Attempting to clone %s to %s", repoURL, tmpDir)))

	command := exec.Command("git", "clone", repoURL, tmpDir)
	session, err := gexec.Start(command, getStyledWriter("git-clone"), getStyledWriter("git-clone"))
	Expect(err).NotTo(HaveOccurred())

	expectExitInBuffer(timeout, session, session.Err)
	Eventually(session.Err).Should(test_helpers.Say(fmt.Sprintf("Cloning into '%s'...", tmpDir)))

	fmt.Fprintf(getStyledWriter("test"), "Cloned %s into %s\n", repoURL, tmpDir)

	return tmpDir
}
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:17,代碼來源:cluster_test_runner.go

示例13:

			})

			itShouldNotColorizeWhitespace(colors.Gray)
		})

		Describe("Bold", func() {
			It("adds the bold color code", func() {
				Expect(colors.Bold("Bold")).To(Equal("\x1b[1mBold\x1b[0m"))
			})

			itShouldNotColorizeWhitespace(colors.Bold)
		})

		Describe("PurpleUnderline", func() {
			It("adds the purple underlined color code", func() {
				Expect(colors.PurpleUnderline("PURPLE UNDERLINE")).To(Equal("\x1b[35;4mPURPLE UNDERLINE\x1b[0m"))
			})

			itShouldNotColorizeWhitespace(colors.PurpleUnderline)
		})

		Describe("NoColor", func() {
			It("adds no color code", func() {
				Expect(colors.NoColor("None")).To(Equal("\x1b[0mNone\x1b[0m"))
			})

			itShouldNotColorizeWhitespace(colors.NoColor)
		})
	})

	Context("when $TERM is not set", func() {
開發者ID:cloudfoundry-incubator,項目名稱:ltc,代碼行數:31,代碼來源:colors_test.go


注:本文中的github.com/cloudfoundry-incubator/ltc/terminal/colors.PurpleUnderline函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。