()
| 1385 | } |
| 1386 | |
| 1387 | func (g ForgeEntity) ForgeURL() string { |
| 1388 | baseURL := strings.TrimRight(g.Credentials.BaseURL, "/") |
| 1389 | |
| 1390 | switch g.Credentials.ForgeType { |
| 1391 | case GiteaEndpointType: |
| 1392 | return g.Credentials.Endpoint.APIBaseURL |
| 1393 | default: |
| 1394 | switch g.EntityType { |
| 1395 | case ForgeEntityTypeRepository: |
| 1396 | return fmt.Sprintf("%s/%s/%s", baseURL, g.Owner, g.Name) |
| 1397 | case ForgeEntityTypeOrganization: |
| 1398 | return fmt.Sprintf("%s/%s", baseURL, g.Owner) |
| 1399 | case ForgeEntityTypeEnterprise: |
| 1400 | return fmt.Sprintf("%s/enterprises/%s", baseURL, g.Owner) |
| 1401 | } |
| 1402 | } |
| 1403 | return "" |
| 1404 | } |
| 1405 | |
| 1406 | func (g ForgeEntity) GetPoolBalancerType() PoolBalancerType { |
| 1407 | if g.PoolBalancerType == "" { |
no outgoing calls
no test coverage detected