forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_table.go
42 lines (33 loc) · 879 Bytes
/
config_table.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
package cmd
import (
boshdir "github.com/cloudfoundry/bosh-cli/director"
boshui "github.com/cloudfoundry/bosh-cli/ui"
boshtbl "github.com/cloudfoundry/bosh-cli/ui/table"
)
type ConfigTable struct {
Config boshdir.Config
UI boshui.UI
}
func (t ConfigTable) Print() {
table := boshtbl.Table{
Content: "config",
Header: []boshtbl.Header{
boshtbl.NewHeader("ID"),
boshtbl.NewHeader("Type"),
boshtbl.NewHeader("Name"),
boshtbl.NewHeader("Created At"),
boshtbl.NewHeader("Content"),
},
Notes: []string{},
FillFirstColumn: true,
Transpose: true,
}
table.Rows = append(table.Rows, []boshtbl.Value{
boshtbl.NewValueString(t.Config.ID),
boshtbl.NewValueString(t.Config.Type),
boshtbl.NewValueString(t.Config.Name),
boshtbl.NewValueString(t.Config.CreatedAt),
boshtbl.NewValueString(t.Config.Content),
})
t.UI.PrintTable(table)
}