(name string, privatePort uint16, host string)
| 216 | } |
| 217 | |
| 218 | func ContainerAddrWithHost(name string, privatePort uint16, host string) string { |
| 219 | c := getContainer(name) |
| 220 | for _, p := range c.Ports { |
| 221 | if p.PrivatePort == privatePort { |
| 222 | return host + ":" + strconv.Itoa(int(p.PublicPort)) |
| 223 | } |
| 224 | } |
| 225 | return host + ":" + strconv.Itoa(int(privatePort)) |
| 226 | } |
| 227 | |
| 228 | func ContainerAddrLocalhost(name string, privatePort uint16) string { |
| 229 | return ContainerAddrWithHost(name, privatePort, "localhost") |
no test coverage detected