• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang colors.PurpleUnderline函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/cloudfoundry-incubator/lattice/ltc/terminal/colors.PurpleUnderline函数的典型用法代码示例。如果您正苦于以下问题:Golang PurpleUnderline函数的具体用法?Golang PurpleUnderline怎么用?Golang PurpleUnderline使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: 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:rowhit,项目名称:lattice,代码行数:9,代码来源:cluster_test_runner.go


示例2: 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:rowhit,项目名称:lattice,代码行数:9,代码来源:cluster_test_runner.go


示例3: 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:rowhit,项目名称:lattice,代码行数:9,代码来源:cluster_test_runner.go


示例4: scaleApp

func (runner *integrationTestRunner) 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).ToNot(HaveOccurred())
	expectExit(timeout, session)
}
开发者ID:rajkumargithub,项目名称:lattice,代码行数:9,代码来源:integration_test_runner.go


示例5: 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:rowhit,项目名称:lattice,代码行数:10,代码来源:cluster_test_runner.go


示例6: 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:rowhit,项目名称:lattice,代码行数:11,代码来源:cluster_test_runner.go


示例7: 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))
}
开发者ID:rowhit,项目名称:lattice,代码行数:11,代码来源:cluster_test_runner.go


示例8: 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:rowhit,项目名称:lattice,代码行数:12,代码来源:cluster_test_runner.go


示例9: 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:rowhit,项目名称:lattice,代码行数:12,代码来源:cluster_test_runner.go


示例10: 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:rowhit,项目名称:lattice,代码行数:13,代码来源:cluster_test_runner.go


示例11: 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:rowhit,项目名称:lattice,代码行数:13,代码来源:cluster_test_runner.go


示例12: uploadBits

func (runner *integrationTestRunner) uploadBits(timeout time.Duration, dropletName, bits string) {
	fmt.Fprintln(getStyledWriter("test"), colors.PurpleUnderline(fmt.Sprintf("Attempting to upload %s to %s", bits, dropletName)))

	command := runner.command("upload-bits", dropletName, bits)

	session, err := gexec.Start(command, getStyledWriter("upload-bits"), getStyledWriter("upload-bits"))
	Expect(err).ToNot(HaveOccurred())
	expectExit(timeout, session)

	Expect(session.Out).To(gbytes.Say("Successfully uploaded " + dropletName))

	fmt.Fprintln(getStyledWriter("test"), "Uploaded", bits, "to", dropletName)
}
开发者ID:rajkumargithub,项目名称:lattice,代码行数:13,代码来源:integration_test_runner.go


示例13: 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:rowhit,项目名称:lattice,代码行数:16,代码来源:cluster_test_runner.go


示例14: 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("/usr/bin/env", "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(gbytes.Say(fmt.Sprintf("Cloning into '%s'...", tmpDir)))

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

	return tmpDir
}
开发者ID:rowhit,项目名称:lattice,代码行数:17,代码来源:cluster_test_runner.go


示例15:

		})

		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)
	})

})
开发者ID:davidwadden,项目名称:lattice-release,代码行数:30,代码来源:colors_test.go



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang colors.Red函数代码示例发布时间:2022-05-23
下一篇:
Golang colors.Green函数代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap