-
Notifications
You must be signed in to change notification settings - Fork 4
/
logo.go
46 lines (37 loc) · 1.01 KB
/
logo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package env
import (
"bytes"
"fmt"
"github.com/dimiro1/banner"
"github.com/kubeshop/testkube/pkg/ui"
)
func logo() string {
buf := bytes.NewBuffer(nil)
/*
templ := `{{ .Title "Frisbee" "" 4 }}
{{ .AnsiColor.BrightCyan }}The title will be ascii and indented 4 spaces{{ .AnsiColor.Default }}
GoVersion: {{ .GoVersion }}
GOOS: {{ .GOOS }}
GOARCH: {{ .GOARCH }}
NumCPU: {{ .NumCPU }}
GOPATH: {{ .GOPATH }}
GOROOT: {{ .GOROOT }}
Compiler: {{ .Compiler }}
ENV: {{ .Env "GOPATH" }}
Now: {{ .Now "Monday, 2 Jan 2006" }}
{{ .AnsiColor.BrightGreen }}This text will appear in Green
{{ .AnsiColor.BrightRed }}This text will appear in Red{{ .AnsiColor.Default }}`
*/
templ := `
{{ .AnsiColor.BrightRed }}
{{ .Title "Frisbee" "" 4 }}
{{ .AnsiColor.BrightGreen }}
`
banner.InitString(buf, true, true, templ)
return buf.String()
}
func Logo() {
fmt.Fprint(ui.Writer, ui.Blue(logo()))
fmt.Fprintln(ui.Writer)
ui.Success("Kubernetes API:", Default.KubeConfig.Host)
}