MCPcopy Create free account
hub / github.com/cloudfoundry/cli / buildPlanToOrgVisibilityMap

Method buildPlanToOrgVisibilityMap

cf/actors/planbuilder/plan_builder.go:147–164  ·  view source on GitHub ↗
(orgName string)

Source from the content-addressed store, hash-verified

145}
146
147func (builder Builder) buildPlanToOrgVisibilityMap(orgName string) (map[string][]string, error) {
148 org, err := builder.orgRepo.FindByName(orgName)
149 if err != nil {
150 return nil, err
151 }
152
153 visibilities, err := builder.servicePlanVisibilityRepo.Search(map[string]string{"organization_guid": org.GUID})
154 if err != nil {
155 return nil, err
156 }
157
158 visMap := make(map[string][]string)
159 for _, vis := range visibilities {
160 visMap[vis.ServicePlanGUID] = []string{org.Name}
161 }
162
163 return visMap, nil
164}
165
166func (builder Builder) buildPlanToOrgsVisibilityMap() (map[string][]string, error) {
167 // Since this map doesn't ever change, we memoize it for performance

Callers 1

AttachOrgToPlansMethod · 0.95

Calls 2

FindByNameMethod · 0.65
SearchMethod · 0.65

Tested by

no test coverage detected