// URL return file's url with given style
504088
func (o OSS) URL(styles ...string) string {
	url := o.Base.URL(styles...)

	newurl, err := Storage.GetURL(url)
	if err != nil || len(newurl) == 0 {
		return url
	}

	return newurl
}
300352
func PrettifyURL(in string) string {
	x := PrettifyURLPath(in)

	if path.Base(x) == "index.html" {
		return path.Dir(x)
	}

	if in == "" {
		return "/"
	}

	return x
}
825378
func (w *Wallet) URL() accounts.URL {
	return accounts.URL{
		Scheme: w.Hub.scheme,
		Path:   fmt.Sprintf("%x", w.PublicKey[1:5]), // Byte #0 isn't unique; 1:5 covers << 64K cards, bump to 1:9 for << 4M
	}
}
475049
func (otp *TOTP) URL(label string) string {
	return otp.OATH.URL(otp.Type(), label)
}
883093
func Url() string {
	n := intRange(0, 3)

	base := `http://www.` + Host()

	switch n {
	case 0:
		break
	case 1:
		base += "/" + Word(2, 8)
	case 2:
		base += "/" + Word(2, 8) + "/" + Word(2, 8) + ".html"
	}
	return base
}
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
}
1316338
func (e IntervalActionInfo) Url() string {
	url := fmt.Sprintf("%s://%s:%v", e.Protocol, e.Host, e.Port)
	return url
}
575874
func URL(u *url.URL) RequestOption {
	return func(req *http.Request) (*http.Request, error) {
		req.URL = u
		return req, nil
	}
}
366636
func (f *fileStorageReader) URL(name string) (string, error) {
	return utils.MakeFileURL(filepath.Join(f.path, name)), nil
}
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()
	}
}
1293269
func PathFromURL(u *url.URL) string {
	path := u.Path
	if runtime.GOOS == "windows" && u.Scheme == fileScheme {
		// Remove leading slash for Windows
		if strings.HasPrefix(path, "/") {
			path = path[1:]
		}
		path = filepath.FromSlash(path)
	}
	return path
}
896506
func (c Config) URL() (u *url.URL) {
	u = &url.URL{}
	if c.HTTPS {
		u.Scheme = "https"
	} else {
		u.Scheme = "http"
	}
	// Fallback to the non proxy domain and ports
	domain := c.ProxyDomain
	if domain == "" {
		domain = c.Domain
	}
	port := c.ProxyPort
	if port == 0 {
		port = c.Port
	}
	if port == 80 {
		u.Host = domain
	} else {
		u.Host = fmt.Sprintf("%s:%d", domain, port)
	}
	return
}
882978
func (a *API) BuildURL(relpath string, args ...interface{}) string {
	if url, err := a.url.Parse(fmt.Sprintf(relpath, args...)); err == nil {
		return url.String()
	}

	return ""
}
818264
func (w *Worker) URL() string {
	select {
	case <-w.catacomb.Dying():
		return ""
	case url := <-w.url:
		return url
	}
}
14203
func (s *ClearScrollService) buildURL() (string, url.Values, error) {
	path, err := uritemplates.Expand("/_search/scroll", map[string]string{})
	if err != nil {
		return "", url.Values{}, err
	}
	return path, url.Values{}, nil
}
482772
func (post *UserPost) URL() *url.URL {
	return &url.URL{
		Host: Configuration.NERDZHost,
		Path: (post.Reference().(*User)).Username + "." + strconv.FormatUint(post.Pid, 10),
	}
}
502544
func (r *Request) URL(uri string) *Request {
	r.URLStruct, r.Error = url.Parse(uri)
	return r
}