MCPcopy Index your code
hub / github.com/cloudfoundry/cli / displayDestinations

Method displayDestinations

command/v7/route_command.go:112–139  ·  view source on GitHub ↗
(route resources.Route, appMap map[string]resources.Application)

Source from the content-addressed store, hash-verified

110}
111
112func (cmd RouteCommand) displayDestinations(route resources.Route, appMap map[string]resources.Application) {
113 destinations := route.Destinations
114 if len(destinations) > 0 {
115 var keyValueTable = [][]string{
116 {
117 cmd.UI.TranslateText("app"),
118 cmd.UI.TranslateText("process"),
119 cmd.UI.TranslateText("port"),
120 cmd.UI.TranslateText("app-protocol"),
121 },
122 }
123
124 for _, destination := range destinations {
125 port := ""
126 if destination.Port != 0 {
127 port = strconv.Itoa(destination.Port)
128 }
129 keyValueTable = append(keyValueTable, []string{
130 appMap[destination.App.GUID].Name,
131 destination.App.Process.Type,
132 port,
133 destination.Protocol,
134 })
135 }
136
137 cmd.UI.DisplayKeyValueTable("\t", keyValueTable, 3)
138 }
139}

Callers 1

ExecuteMethod · 0.95

Calls 2

TranslateTextMethod · 0.65
DisplayKeyValueTableMethod · 0.65

Tested by

no test coverage detected