(path string)
| 56 | type Option func(c *config) error |
| 57 | |
| 58 | func WithSocketPath(path string) Option { |
| 59 | return func(s *config) error { |
| 60 | if path == "" { |
| 61 | return errors.New("no path provided") |
| 62 | } |
| 63 | if s.dialContext != nil { |
| 64 | return errors.New("cannot set socket path and dial") |
| 65 | } |
| 66 | s.dialContext = dialFromPath(path) |
| 67 | return nil |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | func WithDialContext(dialContext func(ctx context.Context, network, addr string) (net.Conn, error)) Option { |
| 72 | return func(s *config) error { |