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

Function collectSecurityGroupRuleRows

command/v7/space_command.go:117–147  ·  view source on GitHub ↗
(spaceSummary v7action.SpaceSummary)

Source from the content-addressed store, hash-verified

115}
116
117func collectSecurityGroupRuleRows(spaceSummary v7action.SpaceSummary) [][]string {
118 var rows [][]string
119
120 for _, securityGroup := range spaceSummary.RunningSecurityGroups {
121 for _, rule := range securityGroup.Rules {
122 rows = append(rows, []string{
123 securityGroup.Name,
124 rule.Destination,
125 nilStringPointer(rule.Ports),
126 rule.Protocol,
127 "running",
128 nilStringPointer(rule.Description),
129 })
130 }
131 }
132
133 for _, securityGroup := range spaceSummary.StagingSecurityGroups {
134 for _, rule := range securityGroup.Rules {
135 rows = append(rows, []string{
136 securityGroup.Name,
137 rule.Destination,
138 nilStringPointer(rule.Ports),
139 rule.Protocol,
140 "staging",
141 nilStringPointer(rule.Description),
142 })
143 }
144 }
145
146 return rows
147}
148
149func nilStringPointer(pointer *string) string {
150 if pointer == nil {

Callers 1

Calls 1

nilStringPointerFunction · 0.85

Tested by

no test coverage detected