Documentation ¶
Index ¶
- Constants
- Variables
- func PromptFailure(label, value string) string
- func PromptSuccess(label, value string) string
- func SelectSuccess(tpls *promptui.SelectTemplates, data interface{}) string
- type Category
- type Feature
- type Plan
- type Product
- type Project
- type Provider
- type Region
- type Resource
- type Team
Constants ¶
View Source
const (
Selected = `{{ "✔" | green }} %s: {{ .Name | cyan }}{{ if .Title }} ({{ .Title }}){{end}}`
)
Variables ¶
View Source
var TplCategory = &promptui.SelectTemplates{ FuncMap: funcMap(), Active: active, Inactive: inactive, Selected: fmt.Sprintf(Selected, "Category"), }
View Source
var TplPlan = &promptui.SelectTemplates{ FuncMap: funcMap(), Active: active, Inactive: inactive, Selected: fmt.Sprintf(Selected, "Plan"), Details: ` Plan: {{ .Name | cyan }} ({{ .Title }}) Price: {{ .Cost | price }} {{- range $i, $el := .Features }} {{- if lt $i 3 }} {{ $el.Name | title }}: {{ $el.Description -}} {{- end -}} {{- end -}}`, }
View Source
var TplProduct = &promptui.SelectTemplates{ FuncMap: funcMap(), Active: active, Inactive: inactive, Selected: fmt.Sprintf(Selected, "Product"), Details: ` Product: {{ .Name | cyan }} ({{ .Title }}) Tagline: {{ .Tagline }} Features: {{- range $i, $el := .Features }} {{- if lt $i 3 }} {{ $el -}} {{- end -}} {{- end -}}`, }
View Source
var TplProject = &promptui.SelectTemplates{ FuncMap: funcMap(), Active: active, Inactive: inactive, Selected: fmt.Sprintf(Selected, "Project"), }
View Source
var TplProvider = &promptui.SelectTemplates{ FuncMap: funcMap(), Active: active, Inactive: inactive, Selected: fmt.Sprintf(Selected, "Provider"), }
View Source
var TplRegion = &promptui.SelectTemplates{ FuncMap: funcMap(), Active: `▸ {{ .Name | cyan | bold }} ({{ .Platform }}::{{ .Location }})`, Inactive: ` {{ .Name | cyan }} ({{ .Platform }}::{{ .Location }})`, Selected: `{{"✔" | green }} Region: {{ .Name }} ({{ .Platform }}::{{ .Location }})`, }
View Source
var TplResource = &promptui.SelectTemplates{ FuncMap: funcMap(), Active: `▸ {{ if .Project }}{{ .Project | bold }}/{{ end }}{{ .Name | cyan | bold }} ({{ .Title }})`, Inactive: ` {{ if .Project }}{{ .Project }}/{{ end }}{{ .Name | cyan }} ({{ .Title }})`, Selected: `{{"✔" | green }} Resource: {{ if .Project }}{{ .Project }}/{{ end }}{{ .Name | cyan }} ({{ .Title }})`, }
View Source
var TplTeam = &promptui.SelectTemplates{ FuncMap: funcMap(), Active: active, Inactive: inactive, Selected: Selected, }
Functions ¶
func PromptFailure ¶
func PromptSuccess ¶
func SelectSuccess ¶
func SelectSuccess(tpls *promptui.SelectTemplates, data interface{}) string
Types ¶
Click to show internal directories.
Click to hide internal directories.