MCPcopy
hub / github.com/grpc/grpc-go / parseTarget

Function parseTarget

clientconn.go:1878–1885  ·  view source on GitHub ↗

parseTarget uses RFC 3986 semantics to parse the given target into a resolver.Target struct containing url. Query params are stripped from the endpoint.

(target string)

Source from the content-addressed store, hash-verified

1876// resolver.Target struct containing url. Query params are stripped from the
1877// endpoint.
1878func parseTarget(target string) (resolver.Target, error) {
1879 u, err := url.Parse(target)
1880 if err != nil {
1881 return resolver.Target{}, err
1882 }
1883
1884 return resolver.Target{URL: *u}, nil
1885}
1886
1887// encodeAuthority escapes the authority string based on valid chars defined in
1888// https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.

Callers 1

Calls 1

ParseMethod · 0.65

Tested by

no test coverage detected