// IsURL returns true if the string represents a valid URL that the
// urlstore can handle.  More specifically it returns true if a string
// begins with 'http://' or 'https://'.
507964
func IsURL(str string) bool {
	return (len(str) > 7 && str[0] == 'h' && str[1] == 't' && str[2] == 't' && str[3] == 'p') &&
		((len(str) > 8 && str[4] == 's' && str[5] == ':' && str[6] == '/' && str[7] == '/') ||
			(str[4] == ':' && str[5] == '/' && str[6] == '/'))
}
384495
func (f *Request) Url(url string) *Request {
	f.url = url
	return f
}
170748
func (client *Client) URL() string {
	client.mu.RLock()
	defer client.mu.RUnlock()

	return client.url
}
1043434
func (r *Request) URL() *URL {
	return NewURL(r.TLS != nil, r.Host+r.RequestURI)
}
1190114
func (b Base) URL(styles ...string) string {
	if b.Url != "" && len(styles) > 0 {
		ext := path.Ext(b.Url)
		return fmt.Sprintf("%v.%v%v", strings.TrimSuffix(b.Url, ext), styles[0], ext)
	}
	return b.Url
}
954856
func IsRequestURL(rawurl string) bool {
	url, err := url.ParseRequestURI(rawurl)
	if err != nil {
		return false //Couldn't even parse the rawurl
	}
	if len(url.Scheme) == 0 {
		return false //No Scheme found
	}
	return true
}
887019
func IsURL(str string) bool {
	if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") {
		return false
	}
	strTemp := str
	if strings.Contains(str, ":") && !strings.Contains(str, "://") {
		// support no indicated urlscheme but with colon for port number
		// http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString
		strTemp = "http://" + str
	}
	u, err := url.Parse(strTemp)
	if err != nil {
		return false
	}
	if strings.HasPrefix(u.Host, ".") {
		return false
	}
	if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) {
		return false
	}
	return rxURL.MatchString(str)
}
990366
func (b *Blob) GetURL() string {
	if b == nil || b.URL == nil {
		return ""
	}
	return *b.URL
}
550678
func (s *Service) Url(publicId string, rtype ResourceType) string {
	path := imageType
	if rtype == PdfType {
		path = pdfType
	} else if rtype == VideoType {
		path = videoType
	} else if rtype == RawType {
		path = rawType
	}
	return fmt.Sprintf("%s/%s/%s/upload/%s", baseResourceUrl, s.cloudName, path, publicId)
}
942789
func (r *Request) Url() string {
	path := "/" + strings.Join(r.IndexList, ",")

	if len(r.TypeList) > 0 {
		path += "/" + strings.Join(r.TypeList, ",")
	}

	// XXX : for indexing documents using the normal (non bulk) API
	if len(r.id) > 0 {
		path += "/" + r.id
	}

	path += "/" + r.api

	u := url.URL{
		Scheme:   "http",
		Host:     fmt.Sprintf("%s:%s", r.Conn.Host, r.Conn.Port),
		Path:     path,
		RawQuery: r.ExtraArgs.Encode(),
	}

	return u.String()
}
491440
func (otp *HOTP) URL(label string) string {
	return otp.OATH.URL(otp.Type(), label)
}
38166
func (ns *Namespace) URL(a interface{}) (template.URL, error) {
	s, err := cast.ToStringE(a)
	return template.URL(s), err
}
539056
func IsValidURL(name string, location string) error {
	_, err := url.Parse(location)
	if err != nil {
		return fmt.Errorf("%s is not a valid URL", location)
	}
	return nil
}
913506
func (u URL) String() string {
	if u.Scheme != "" {
		return fmt.Sprintf("%s://%s", u.Scheme, u.Path)
	}
	return u.Path
}
1009629
func UrlEquals(tab *Tab, equalsUrl string) ConditionalFunc {
	return func(tab *Tab) bool {
		if url, err := tab.GetCurrentUrl(); err == nil && url == equalsUrl {
			return true
		}
		return false
	}
}
233806
func (c *Client) URL(uri string) *Client {
	c.Use(url.URL(uri))
	return c
}
385193
func (r *Store) URL() string {
	if r.url == nil {
		return ""
	}
	return r.url.String()
}