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

Method FindPort

cf/actors/routes.go:157–172  ·  view source on GitHub ↗
(routeName string)

Source from the content-addressed store, hash-verified

155}
156
157func (routeActor routeActor) FindPort(routeName string) (string, int, error) {
158 var err error
159 routeSlice := strings.Split(routeName, ":")
160 port := 0
161 if len(routeSlice) == 2 {
162 port, err = strconv.Atoi(routeSlice[1])
163 if err != nil {
164 return "", 0, errors.New(T("Invalid port for route {{.RouteName}}",
165 map[string]interface{}{
166 "RouteName": routeName,
167 },
168 ))
169 }
170 }
171 return routeSlice[0], port, nil
172}
173
174func (routeActor routeActor) replaceDomain(routeWithoutPathAndPort string, domain string) (string, error) {
175 _, flagDomain, err := routeActor.FindDomain(domain)

Callers 1

FindAndBindRouteMethod · 0.95

Calls 1

NewFunction · 0.92

Tested by

no test coverage detected