MCPcopy
hub / github.com/dgraph-io/dgraph / ContainerAddrWithHost

Function ContainerAddrWithHost

testutil/docker.go:218–226  ·  view source on GitHub ↗
(name string, privatePort uint16, host string)

Source from the content-addressed store, hash-verified

216}
217
218func 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
228func ContainerAddrLocalhost(name string, privatePort uint16) string {
229 return ContainerAddrWithHost(name, privatePort, "localhost")

Callers 2

ContainerAddrLocalhostFunction · 0.85
ContainerAddrFunction · 0.85

Calls 1

getContainerFunction · 0.85

Tested by

no test coverage detected