MCPcopy Index your code
hub / github.com/docker/cli / ParseURL

Function ParseURL

cli/connhelper/ssh/ssh.go:15–25  ·  view source on GitHub ↗

ParseURL creates a [Spec] from the given ssh URL. It returns an error if the URL is using the wrong scheme, contains fragments, query-parameters, or contains a password.

(daemonURL string)

Source from the content-addressed store, hash-verified

13// the URL is using the wrong scheme, contains fragments, query-parameters,
14// or contains a password.
15func ParseURL(daemonURL string) (*Spec, error) {
16 u, err := url.Parse(daemonURL)
17 if err != nil {
18 var urlErr *url.Error
19 if errors.As(err, &urlErr) {
20 err = urlErr.Unwrap()
21 }
22 return nil, fmt.Errorf("invalid SSH URL: %w", err)
23 }
24 return NewSpec(u)
25}
26
27// NewSpec creates a [Spec] from the given ssh URL's properties. It returns
28// an error if the URL is using the wrong scheme, contains fragments,

Callers 2

TestParseURLFunction · 0.85
TestCommandFunction · 0.85

Calls 2

NewSpecFunction · 0.85
UnwrapMethod · 0.45

Tested by 2

TestParseURLFunction · 0.68
TestCommandFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…