MCPcopy
hub / github.com/docker/compose / Dial

Function Dial

internal/memnet/conn.go:36–50  ·  view source on GitHub ↗
(ctx context.Context, network, addr string)

Source from the content-addressed store, hash-verified

34}
35
36func Dial(ctx context.Context, network, addr string) (net.Conn, error) {
37 var d net.Dialer
38 switch network {
39 case "unix":
40 if err := validateSocketPath(addr); err != nil {
41 return nil, err
42 }
43 return d.DialContext(ctx, "unix", addr)
44 case "npipe":
45 // N.B. this will return an error on non-Windows
46 return dialNamedPipe(ctx, addr)
47 default:
48 return nil, fmt.Errorf("unsupported network: %s", network)
49 }
50}

Callers 1

DialEndpointFunction · 0.85

Calls 2

validateSocketPathFunction · 0.70
dialNamedPipeFunction · 0.70

Tested by

no test coverage detected