-
Notifications
You must be signed in to change notification settings - Fork 2
/
constants.go
35 lines (34 loc) · 1.14 KB
/
constants.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
package main
const (
jobsListFormat = `{{range .Jobs}}* {{.Name}}{{println}}{{end}}`
allocationsFormat = `{{range .Allocations}}* {{.Name}}{{println}}{{end}}`
allocationDetailsFormat = `{{range $index, $task := .Tasks}}({{$index}}) {{$task.Name}}{{println}}{{end}}`
taskGroupsListFormat = `{{range .TaskGroups}}* {{.Name}}{{println}}{{end}}`
taskDetailsFormat = `{{- "" -}}
* Name: {{ .Task.Name }}
* Node Name: {{ .Node.Name }}
* Node IP: {{ .Node.IP }}
* Driver: {{ .Task.Driver }}{{println}}
{{- range $configKey, $configValue := .Task.Config -}}
{{" * "}}{{$configKey}}: {{$configValue}}{{println}}
{{- end -}}
{{- if .Environment -}}
* Env:{{println}}
{{- range $key, $value := .Environment -}}
{{" * "}}{{$key}}: {{$value.Value}}{{println}}
{{- end -}}
{{- end -}}
{{- if .Network.ReservedPorts -}}
* Reserved Ports:{{println}}
{{- range .Network.ReservedPorts -}}
{{" * "}}{{.Number}} ({{.Name}}){{println}}
{{- end -}}
{{- end -}}
{{- if .Network.DynamicPorts -}}
* Dynamic Ports:{{println}}
{{- range .Network.DynamicPorts -}}
{{" * "}}{{.Number}} ({{.Name}}){{println}}
{{- end}}
{{- end -}}
{{- "" -}}`
)