NewPathClient returns a new client accessing a subpath of c.
(path string)
| 226 | |
| 227 | // NewPathClient returns a new client accessing a subpath of c. |
| 228 | func (c *Client) NewPathClient(path string) (*Client, error) { |
| 229 | u, err := url.Parse(c.server) |
| 230 | if err != nil { |
| 231 | return nil, fmt.Errorf("bogus server %q for NewPathClient receiver: %v", c.server, err) |
| 232 | } |
| 233 | u.Path = path |
| 234 | pc, err := New(OptionServer(u.String())) |
| 235 | if err != nil { |
| 236 | return nil, err |
| 237 | } |
| 238 | pc.authMode = c.authMode |
| 239 | pc.discoOnce.Do(noop) |
| 240 | return pc, nil |
| 241 | } |
| 242 | |
| 243 | // TransportConfig contains options for how HTTP requests are made. |
| 244 | type TransportConfig struct { |
no test coverage detected