templates

package
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2018 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

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 PromptFailure(label, value string) string

func PromptSuccess

func PromptSuccess(label, value string) string

func SelectSuccess

func SelectSuccess(tpls *promptui.SelectTemplates, data interface{}) string

Types

type Category added in v0.15.0

type Category struct {
	Name  string
	Title string
}

func Categories added in v0.15.0

func Categories(list map[string][]*cModels.Product) []Category

type Feature

type Feature struct {
	Name        string
	Description string
}

type Plan

type Plan struct {
	Name     string
	Title    string
	Cost     int
	Features []Feature
}

func Plans

func Plans(list []*cModels.Plan) []Plan

type Product

type Product struct {
	Name     string
	Title    string
	Tagline  string
	Features []string
	Tags     []string
}

func Products

func Products(list []*cModels.Product) []Product

type Project

type Project struct {
	Name  string
	Title string
}

func Projects

func Projects(list []*mModels.Project) []Project

type Provider

type Provider struct {
	Name  string
	Title string
}

func Providers

func Providers(list []*cModels.Provider) []Provider

type Region

type Region struct {
	Name     string
	Platform string
	Location string
}

func Regions

func Regions(list []*cModels.Region) []Region

type Resource

type Resource struct {
	Name    string
	Title   string
	Project string
}

func Resources

func Resources(list []*mModels.Resource, projects []*mModels.Project) []Resource

type Team

type Team struct {
	Name  string
	Title string
}

func Teams

func Teams(list []*iModels.Team) []Team

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL