GetPublishedPort returns the host-exposed public port of a container.
(serviceName string)
| 596 | |
| 597 | // GetPublishedPort returns the host-exposed public port of a container. |
| 598 | func (app *DdevApp) GetPublishedPort(serviceName string) (int, error) { |
| 599 | exposedPort := GetInternalPort(app, serviceName) |
| 600 | exposedPortInt, err := strconv.Atoi(exposedPort) |
| 601 | if err != nil { |
| 602 | return -1, err |
| 603 | } |
| 604 | return app.GetPublishedPortForPrivatePort(serviceName, uint16(exposedPortInt)) |
| 605 | } |
| 606 | |
| 607 | // GetPublishedPortForPrivatePort returns the host-exposed public port of a container for a given private port. |
| 608 | func (app *DdevApp) GetPublishedPortForPrivatePort(serviceName string, privatePort uint16) (publicPort int, err error) { |