c71555f030
libnetwork.Endpoint is an interface with a single implementation. https://github.com/golang/go/wiki/CodeReviewComments#interfaces Signed-off-by: Cory Snider <csnider@mirantis.com>
13 lines
342 B
Go
13 lines
342 B
Go
package daemon
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/docker/docker/libnetwork"
|
|
)
|
|
|
|
// getEndpointInNetwork returns the container's endpoint to the provided network.
|
|
func getEndpointInNetwork(name string, n libnetwork.Network) (*libnetwork.Endpoint, error) {
|
|
endpointName := strings.TrimPrefix(name, "/")
|
|
return n.EndpointByName(endpointName)
|
|
}
|