MCPcopy
hub / github.com/cloudfoundry/cli / NewRepositoryLocator

Function NewRepositoryLocator

cf/api/repository_locator.go:77–141  ·  view source on GitHub ↗
(config coreconfig.ReadWriter, gatewaysByName map[string]net.Gateway, logger trace.Printer, envDialTimeout string)

Source from the content-addressed store, hash-verified

75}
76
77func NewRepositoryLocator(config coreconfig.ReadWriter, gatewaysByName map[string]net.Gateway, logger trace.Printer, envDialTimeout string) (loc RepositoryLocator) {
78 cloudControllerGateway := gatewaysByName["cloud-controller"]
79 routingAPIGateway := gatewaysByName["routing-api"]
80 uaaGateway := gatewaysByName["uaa"]
81 loc.authRepo = authentication.NewUAARepository(uaaGateway, config, net.NewRequestDumper(logger))
82
83 // ensure gateway refreshers are set before passing them by value to repositories
84 cloudControllerGateway.SetTokenRefresher(loc.authRepo)
85 uaaGateway.SetTokenRefresher(loc.authRepo)
86
87 loc.appBitsRepo = applicationbits.NewCloudControllerApplicationBitsRepository(config, cloudControllerGateway)
88 loc.appEventsRepo = appevents.NewCloudControllerAppEventsRepository(config, cloudControllerGateway)
89 loc.appFilesRepo = api_appfiles.NewCloudControllerAppFilesRepository(config, cloudControllerGateway)
90 loc.appRepo = applications.NewCloudControllerRepository(config, cloudControllerGateway)
91 loc.appSummaryRepo = NewCloudControllerAppSummaryRepository(config, cloudControllerGateway)
92 loc.appInstancesRepo = appinstances.NewCloudControllerAppInstancesRepository(config, cloudControllerGateway)
93 loc.authTokenRepo = NewCloudControllerServiceAuthTokenRepository(config, cloudControllerGateway)
94 loc.curlRepo = NewCloudControllerCurlRepository(config, cloudControllerGateway)
95 loc.domainRepo = NewCloudControllerDomainRepository(config, cloudControllerGateway)
96 loc.endpointRepo = NewEndpointRepository(cloudControllerGateway)
97
98 configV3, err := configv3.GetCFConfig()
99 if err != nil {
100 panic("handle this error!")
101 }
102
103 logCacheURL := configV3.ConfigFile.LogCacheEndpoint
104 logCacheClient, err := logcache.NewClient(logCacheURL, configV3, nil, v7action2.NewDefaultKubernetesConfigGetter())
105 if err != nil {
106 panic("handle this error!")
107 }
108
109 loc.logsRepo = logs.NewLogCacheRepository(logCacheClient, sharedaction.GetRecentLogs, sharedaction.GetStreamingLogs)
110
111 loc.organizationRepo = organizations.NewCloudControllerOrganizationRepository(config, cloudControllerGateway)
112 loc.passwordRepo = password.NewCloudControllerRepository(config, uaaGateway)
113 loc.quotaRepo = quotas.NewCloudControllerQuotaRepository(config, cloudControllerGateway)
114 loc.routeRepo = NewCloudControllerRouteRepository(config, cloudControllerGateway)
115 loc.routeServiceBindingRepo = NewCloudControllerRouteServiceBindingRepository(config, cloudControllerGateway)
116 loc.routingAPIRepo = NewRoutingAPIRepository(config, routingAPIGateway)
117 loc.stackRepo = stacks.NewCloudControllerStackRepository(config, cloudControllerGateway)
118 loc.serviceRepo = NewCloudControllerServiceRepository(config, cloudControllerGateway)
119 loc.serviceKeyRepo = NewCloudControllerServiceKeyRepository(config, cloudControllerGateway)
120 loc.serviceBindingRepo = NewCloudControllerServiceBindingRepository(config, cloudControllerGateway)
121 loc.serviceBrokerRepo = NewCloudControllerServiceBrokerRepository(config, cloudControllerGateway)
122 loc.servicePlanRepo = NewCloudControllerServicePlanRepository(config, cloudControllerGateway)
123 loc.servicePlanVisibilityRepo = NewCloudControllerServicePlanVisibilityRepository(config, cloudControllerGateway)
124 loc.serviceSummaryRepo = NewCloudControllerServiceSummaryRepository(config, cloudControllerGateway)
125 loc.spaceRepo = spaces.NewCloudControllerSpaceRepository(config, cloudControllerGateway)
126 loc.userProvidedServiceInstanceRepo = NewCCUserProvidedServiceInstanceRepository(config, cloudControllerGateway)
127 loc.userRepo = NewCloudControllerUserRepository(config, uaaGateway, cloudControllerGateway)
128 loc.clientRepo = NewCloudControllerClientRepository(config, uaaGateway)
129 loc.buildpackRepo = NewCloudControllerBuildpackRepository(config, cloudControllerGateway)
130 loc.buildpackBitsRepo = NewCloudControllerBuildpackBitsRepository(config, cloudControllerGateway, appfiles.ApplicationZipper{})
131 loc.securityGroupRepo = securitygroups.NewSecurityGroupRepo(config, cloudControllerGateway)
132 loc.stagingSecurityGroupRepo = staging.NewSecurityGroupsRepo(config, cloudControllerGateway)
133 loc.runningSecurityGroupRepo = running.NewSecurityGroupsRepo(config, cloudControllerGateway)
134 loc.securityGroupSpaceBinder = securitygroupspaces.NewSecurityGroupSpaceBinder(config, cloudControllerGateway)

Callers 1

NewDependencyFunction · 0.92

Tested by

no test coverage detected