// cloneURL shallow clones the src *url.URL
974400
func cloneURL(src *url.URL) *url.URL {
	dst := &url.URL{}
	*dst = *src

	return dst
}
990366
func (b *Blob) GetURL() string {
	if b == nil || b.URL == nil {
		return ""
	}
	return *b.URL
}
1273654
func TypeURL(v interface{}) (string, error) {
	mu.Lock()
	u, ok := registry[tryDereference(v)]
	mu.Unlock()
	if !ok {
		// fallback to the proto registry if it is a proto message
		pb, ok := v.(proto.Message)
		if !ok {
			return "", errors.Wrapf(ErrNotFound, "type %s", reflect.TypeOf(v))
		}
		return proto.MessageName(pb), nil
	}
	return u, nil
}
1192611
func (cli *Client) BuildURL(urlPath ...string) string {
	ps := []string{cli.Prefix}
	for _, p := range urlPath {
		ps = append(ps, p)
	}
	return cli.BuildBaseURL(ps...)
}
127799
func (s *OriginEndpoint) SetUrl(v string) *OriginEndpoint {
	s.Url = &v
	return s
}
652211
func (c *Client) createURL(e ...Endpoint) *url.URL {
	mu := *c.url
	for _, f := range e {
		f(&mu)
	}
	return &mu
}
521664
func CopyURL(u *url.URL) (ret *url.URL) {
	ret = new(url.URL)
	*ret = *u
	if u.User != nil {
		ret.User = new(url.Userinfo)
		*ret.User = *u.User
	}
	return
}
1101241
func (s *Artifact) SetUrl(v string) *Artifact {
	s.Url = &v
	return s
}
1183339
func (s *OutputDestinationSettings) SetUrl(v string) *OutputDestinationSettings {
	s.Url = &v
	return s
}
622541
func (s *Schema) BaseURL() *url.URL {
	scope := s.Scope()
	u, err := url.Parse(scope)
	if err != nil {
		// XXX hmm, not sure what to do here
		u = &url.URL{}
	}

	return u
}
451953
func (s *Sample) SetUrl(v string) *Sample {
	s.Url = &v
	return s
}
988939
func (s *Source) SetUrl(v string) *Source {
	s.Url = &v
	return s
}
898342
func BaseUrl() (*url.URL, error) {
	// returning cached value
	// Avoid repeated logging
	if kopsBaseUrl != nil {
		glog.V(8).Infof("Using cached kopsBaseUrl url: %q", kopsBaseUrl.String())
		return copyBaseURL(kopsBaseUrl)
	}

	baseUrlString := os.Getenv("KOPS_BASE_URL")
	var err error
	if baseUrlString == "" {
		baseUrlString = fmt.Sprintf(defaultKopsBaseUrl, kops.Version)
		glog.V(8).Infof("Using default base url: %q", baseUrlString)
		kopsBaseUrl, err = url.Parse(baseUrlString)
		if err != nil {
			return nil, fmt.Errorf("unable to parse %q as a url: %v", baseUrlString, err)
		}
	} else {
		kopsBaseUrl, err = url.Parse(baseUrlString)
		if err != nil {
			return nil, fmt.Errorf("unable to parse env var KOPS_BASE_URL %q as a url: %v", baseUrlString, err)
		}
		glog.Warningf("Using base url from KOPS_BASE_URL env var: %q", baseUrlString)
	}

	return copyBaseURL(kopsBaseUrl)
}
639966
func (s *InputDestination) SetUrl(v string) *InputDestination {
	s.Url = &v
	return s
}
1053466
func (s *NotebookInstanceSummary) SetUrl(v string) *NotebookInstanceSummary {
	s.Url = &v
	return s
}
1058888
func RequestedURL(r *http.Request) (ret *url.URL) {
	ret = CopyURL(r.URL)
	ret.Host = r.Host
	ret.Scheme = OriginatingProtocol(r)
	return
}
884596
func Clone(r *http.Request) *SerializableHttpRequest {
	if r == nil {
		return nil
	}

	rc := new(SerializableHttpRequest)
	rc.Method = r.Method
	rc.URL = r.URL
	rc.Proto = r.Proto
	rc.ProtoMajor = r.ProtoMajor
	rc.ProtoMinor = r.ProtoMinor
	rc.Header = r.Header
	rc.ContentLength = r.ContentLength
	rc.Host = r.Host
	rc.RemoteAddr = r.RemoteAddr
	rc.RequestURI = r.RequestURI
	return rc
}