// URL provides a valid, parsed url.URL.
329065
func (p *parserMixin) URLVar(target **url.URL) {
	p.SetValue(newURLValue(target))
}
1253069
func (g *Generator) URL() string {
	part := func() string {
		return g.LimitedWord(2, 8)
	}
	start := g.OneStringOf("http://www.", "http://blog.", "https://www.", "ftp://")
	ext := g.OneStringOf("html", "php", "jpg", "mp3", "txt")
	variant := g.Percent()
	switch {
	case variant < 20:
		return start + part() + "." + g.Domain() + "/" + part() + "." + ext
	case variant > 80:
		return start + part() + "." + g.Domain() + "/" + part() + "/" + part() + "." + ext
	default:
		return start + part() + "." + g.Domain()
	}
}
1356164
func (s *ADMMessage) SetUrl(v string) *ADMMessage {
	s.Url = &v
	return s
}
818264
func (w *Worker) URL() string {
	select {
	case <-w.catacomb.Dying():
		return ""
	case url := <-w.url:
		return url
	}
}
848892
func isURL(s string) bool {
	return strings.HasPrefix(s, "http://") || strings.HasPrefix(s, "https://")
}
270543
func (token *Token) URL() string {

	return fmt.Sprintf(
		"otpauth://totp/%s:%s?secret=%s&issuer=%s",
		token.Provider,
		token.User,
		token.Secret,
		token.Provider,
	)
}
1265557
func (s *GetAssessmentReportOutput) SetUrl(v string) *GetAssessmentReportOutput {
	s.Url = &v
	return s
}
1358118
func (mrt MarkdownRichText) URL(text string, url string) string {
	repalcer := strings.NewReplacer("[", "⟦", "]", "⟧", "(", "❨", ")", "❩")
	text = fmt.Sprintf("[%s](%s)", repalcer.Replace(text), url)
	return text
}
84540
func (r *routeRegexp) url(values map[string]string) (string, error) {
	urlValues := make([]interface{}, len(r.varsN))
	for k, v := range r.varsN {
		value, ok := values[v]
		if !ok {
			return "", fmt.Errorf("mux: missing route variable %q", v)
		}
		if r.regexpType == regexpTypeQuery {
			value = url.QueryEscape(value)
		}
		urlValues[k] = value
	}
	rv := fmt.Sprintf(r.reverse, urlValues...)
	if !r.regexp.MatchString(rv) {
		// The URL is checked against the full regexp, instead of checking
		// individual variables. This is faster but to provide a good error
		// message, we check individual regexps if the URL doesn't match.
		for k, v := range r.varsN {
			if !r.varsR[k].MatchString(values[v]) {
				return "", fmt.Errorf(
					"mux: variable %q doesn't match, expected %q", values[v],
					r.varsR[k].String())
			}
		}
	}
	return rv, nil
}
513532
func parseURL(urlString string) (*url.URL, error) {
	url, parseErr := url.Parse(urlString)
	if parseErr != nil {
		return nil, parseErr
	}
	if url == nil {
		return nil, fmt.Errorf("No URL")
	}
	return url, nil
}
740758
func (parser *Parser) ParseUrl(url string) error {
	if !parser.initialised {
		if err := parser.init(); err != nil {
			return err
		}
	}

	response, err := http.Get(url)

	if err != nil {
		return err
	}

	defer response.Body.Close()
	contents, err := ioutil.ReadAll(response.Body)

	if err != nil {
		return err
	}

	return parser.rt.run(string(contents))
}
1193205
func (b *UpdateService) url() (string, url.Values, error) {
	// Build url
	var path string
	var err error
	if b.typ == "_doc" {
		path, err = uritemplates.Expand("/{index}/_update/{id}", map[string]string{
			"index": b.index,
			"id":    b.id,
		})
	} else {
		path, err = uritemplates.Expand("/{index}/{type}/{id}/_update", map[string]string{
			"index": b.index,
			"type":  b.typ,
			"id":    b.id,
		})
	}
	if err != nil {
		return "", url.Values{}, err
	}

	// Parameters
	params := make(url.Values)
	if b.pretty {
		params.Set("pretty", "true")
	}
	if b.routing != "" {
		params.Set("routing", b.routing)
	}
	if b.parent != "" {
		params.Set("parent", b.parent)
	}
	if b.timeout != "" {
		params.Set("timeout", b.timeout)
	}
	if b.refresh != "" {
		params.Set("refresh", b.refresh)
	}
	if b.waitForActiveShards != "" {
		params.Set("wait_for_active_shards", b.waitForActiveShards)
	}
	if len(b.fields) > 0 {
		params.Set("fields", strings.Join(b.fields, ","))
	}
	if b.version != nil {
		params.Set("version", fmt.Sprintf("%d", *b.version))
	}
	if b.versionType != "" {
		params.Set("version_type", b.versionType)
	}
	if b.retryOnConflict != nil {
		params.Set("retry_on_conflict", fmt.Sprintf("%v", *b.retryOnConflict))
	}

	return path, params, nil
}
482772
func (post *UserPost) URL() *url.URL {
	return &url.URL{
		Host: Configuration.NERDZHost,
		Path: (post.Reference().(*User)).Username + "." + strconv.FormatUint(post.Pid, 10),
	}
}
1246605
func (c *client) URL(key string, fallback *url.URL) *url.URL {
	if v := c.Getenv(key); v != "" {
		u, err := url.Parse(v)
		if err != nil {
			return fallback
		}

		return u
	}

	return fallback
}
585270
func (s *Server) URL(name string, params ...interface{}) string {
	if r := s.routes[name]; r != nil {
		return r.URL(params)
	}
	return ""
}
409072
func (h *AsyncHttpHandler) Url() string {
	h.manager.lock.RLock()
	defer h.manager.lock.RUnlock()

	return h.manager.route + "/" + h.id
}
1046915
func (s *Subdomains) URL(purl string, args ...string) string {
	info := s.Get(args...)
	if info == nil {
		return purl
	}
	if len(info.Host) < 1 {
		if s.Default == info.Name {
			return purl
		}
		return `/` + info.Name + purl
	}
	if len(s.Protocol) < 1 {
		return `http://` + info.Host + purl
	}
	return s.Protocol + `://` + info.Host + purl
}