本文整理汇总了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;未经允许,请勿转载。 |
请发表评论