MCPcopy Create free account
hub / github.com/efficientgo/e2e / Endpoint

Method Endpoint

env_docker.go:512–525  ·  view source on GitHub ↗

Endpoint returns external (from host perspective) service endpoint (host:port) for given port name. External means that it will be accessible only from host, but not from docker containers. If your service is not running, this method returns incorrect `stopped` endpoint.

(portName string)

Source from the content-addressed store, hash-verified

510//
511// If your service is not running, this method returns incorrect `stopped` endpoint.
512func (d *dockerRunnable) Endpoint(portName string) string {
513 if !d.IsRunning() {
514 return "stopped"
515 }
516
517 // Map the container port to the local port.
518 localPort, ok := d.hostPorts[portName]
519 if !ok {
520 return ""
521 }
522
523 // Do not use "localhost", because it doesn't work with the AWS DynamoDB client.
524 return fmt.Sprintf("127.0.0.1:%d", localPort)
525}
526
527// InternalEndpoint returns internal service endpoint (host:port) for given internal port.
528// Internal means that it will be accessible only from docker containers within the network that this

Callers

nothing calls this directly

Calls 1

IsRunningMethod · 0.95

Tested by

no test coverage detected