(u *url.URL, next xproxy.Dialer)
| 194 | } |
| 195 | |
| 196 | func NewHintsSettingDialerFromURL(u *url.URL, next xproxy.Dialer) (xproxy.Dialer, error) { |
| 197 | values, err := url.ParseQuery(u.RawQuery) |
| 198 | if err != nil { |
| 199 | return nil, fmt.Errorf("HintsSettingDialer parameter parsing failed: %w", err) |
| 200 | } |
| 201 | |
| 202 | if !values.Has("hints") { |
| 203 | return nil, errors.New("no \"hints\" parameter is provided in HintsSettingDialer configuration URL") |
| 204 | } |
| 205 | |
| 206 | return &HintsSettingDialer{ |
| 207 | hints: values.Get("hints"), |
| 208 | next: MaybeWrapWithContextDialer(next), |
| 209 | }, nil |
| 210 | } |
| 211 | |
| 212 | func (hs *HintsSettingDialer) Dial(network, address string) (net.Conn, error) { |
| 213 | return hs.DialContext(context.Background(), network, address) |
nothing calls this directly
no test coverage detected