| 155 | } |
| 156 | |
| 157 | func (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 | |
| 174 | func (routeActor routeActor) replaceDomain(routeWithoutPathAndPort string, domain string) (string, error) { |
| 175 | _, flagDomain, err := routeActor.FindDomain(domain) |