(ctx context.Context, endpoint string)
| 24 | ) |
| 25 | |
| 26 | func DialEndpoint(ctx context.Context, endpoint string) (net.Conn, error) { |
| 27 | if addr, ok := strings.CutPrefix(endpoint, "unix://"); ok { |
| 28 | return Dial(ctx, "unix", addr) |
| 29 | } |
| 30 | if addr, ok := strings.CutPrefix(endpoint, "npipe://"); ok { |
| 31 | return Dial(ctx, "npipe", addr) |
| 32 | } |
| 33 | return nil, fmt.Errorf("unsupported protocol for address: %s", endpoint) |
| 34 | } |
| 35 | |
| 36 | func Dial(ctx context.Context, network, addr string) (net.Conn, error) { |
| 37 | var d net.Dialer |
no test coverage detected