mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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>
14 lines
342 B
Go
14 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)
|
|
}
|