NewClientWithUnixSocket returns an http.Client with the correct timeout. It internally uses NewClientCustom with a custom dialer connecting to the specified unix domain socket.
(ctx context.Context, path string)
| 324 | // It internally uses NewClientCustom with a custom dialer connecting to |
| 325 | // the specified unix domain socket. |
| 326 | func NewClientWithUnixSocket(ctx context.Context, path string) *http.Client { |
| 327 | return NewClientCustom(ctx, func(t *http.Transport) { |
| 328 | t.DialContext = func(reqCtx context.Context, network, addr string) (net.Conn, error) { |
| 329 | return NewDialer(ctx).DialContext(reqCtx, "unix", path) |
| 330 | } |
| 331 | }) |
| 332 | } |
| 333 | |
| 334 | // Transport is our http Transport which wraps an http.Transport |
| 335 | // * Sets the User Agent |
no test coverage detected
searching dependent graphs…