MCPcopy
hub / github.com/perkeep/perkeep / NewPathClient

Method NewPathClient

pkg/client/client.go:228–241  ·  view source on GitHub ↗

NewPathClient returns a new client accessing a subpath of c.

(path string)

Source from the content-addressed store, hash-verified

226
227// NewPathClient returns a new client accessing a subpath of c.
228func (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.
244type TransportConfig struct {

Callers 1

RunCommandMethod · 0.80

Calls 4

OptionServerFunction · 0.85
ParseMethod · 0.80
NewFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected