File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package api
22
33import (
44 "bytes"
5+ "fmt"
56 "text/template"
67)
78
@@ -24,6 +25,7 @@ type AppSettings struct {
2425 Routable * bool `json:"routable,omitempty"`
2526 Whitelist []string `json:"whitelist,omitempty"`
2627 Autoscale map [string ]* Autoscale `json:"autoscale,omitempty"`
28+ Label Labels `json:"label,omitempty"`
2729}
2830
2931// NewRoutable returns a default value for the AppSettings.Routable field.
@@ -61,3 +63,17 @@ type Autoscale struct {
6163 Max int `json:"max"`
6264 CPUPercent int `json:"cpu_percent"`
6365}
66+
67+ // Labels can contain any user-defined key value
68+ type Labels map [string ]interface {}
69+
70+ func (l Labels ) String () string {
71+ var buffer bytes.Buffer
72+ for k , v := range l {
73+ if buffer .Len () > 0 {
74+ buffer .WriteString ("\n " )
75+ }
76+ buffer .WriteString (fmt .Sprintf ("%-16s %s" , k + ":" , v ))
77+ }
78+ return buffer .String ()
79+ }
You can’t perform that action at this time.
0 commit comments