// URI returns the URI of the reference.
555127
func (r *Reference) URI() string {
	if r == nil {
		return ""
	}
	return fmt.Sprintf("%s", r.uri)
}
44704
func URL(c CloneURL, path string) *Resource {
	r := &Resource{u: c.URL()}
	r.u.Path = Path + path
	return r
}
414115
func (c *OAuthAccessCall) RedirectURI(redirectURI string) *OAuthAccessCall {
	c.redirectURI = redirectURI
	return c
}
812446
func (k RRSetKey) URI() string {
	uri := fmt.Sprintf("zones/%s/rrsets", k.Zone)
	if k.Type != "" {
		uri += fmt.Sprintf("/%v", k.Type)
		if k.Name != "" {
			uri += fmt.Sprintf("/%v", k.Name)
		}
	}
	return uri
}
1040867
func (k RRSetKey) QueryURI(offset int) string {
	// TODO: find a more appropriate place to set "" to "ANY"
	if k.Type == "" {
		k.Type = "ANY"
	}
	return fmt.Sprintf("%s?offset=%d", k.URI(), offset)
}
1345498
func MakeURI(prot string, host string) string {
	if prot == "" {
		return host
	}
	if prot[len(prot)-1] != ':' {
		prot += ":"
	}
	return prot + "//" + host
}
400672
func (r *Request) URL(uri string) *Request {
	r.Use(url.URL(uri))
	return r
}
254728
func (server *UnixServer) URI() string {
	if server.listener == nil {
		panic(ErrServerIsNotStarted)
	}
	return "unix:" + server.listener.Addr().String()
}
833389
func (id *SpiffeIDService) URI() *url.URL {
	var result url.URL
	result.Scheme = "spiffe"
	result.Host = id.Host
	result.Path = fmt.Sprintf("/ns/%s/dc/%s/svc/%s",
		id.Namespace, id.Datacenter, id.Service)
	return &result
}
740011
func (post *UserPost) Reference() Reference {
	user, _ := NewUser(post.NumericReference())
	return user
}
18001
func DecodeURI(uri string) (raw string, err error) {
	defer func() {
		if r := recover(); r != nil {
			err = r.(*js.Error)
		}
	}()
	raw = js.Global.Call("decodeURI", uri).String()
	return
}
1128651
func isURI(v interface{}) bool {
	s, ok := v.(string)
	if !ok {
		return false
	}
	u, err := url.Parse(s)
	return err == nil && u.IsAbs()
}
381630
func URL(url string) func(c *Config) {
	return func(c *Config) {
		c.URL = url
	}
}
311846
func createRequestURI(base string, params url.Values) string {
	if len(params) != 0 {
		base += "?" + params.Encode()
	}
	return base
}
78589
func (k AccountKey) URI() string {
	uri := "accounts"
	if k != "" {
		uri = fmt.Sprintf("accounts/%s", k)
	}
	return uri
}
602333
func (r *Application) AddUris(newUris ...string) *Application {
	if r.Uris == nil {
		r.EmptyUris()
	}

	uris := *r.Uris
	uris = append(uris, newUris...)
	r.Uris = &uris

	return r
}
573850
func (this *Response) Location(uri string) {

	app := this.app
	req := this.req

	/*
	   If the given uri == "back" then try and get the "Referer"; or use "/"
	*/

	if uri == "back" {
		uri = req.Get("Referer")
		if uri == "" {
			uri = "/"
		}
	}

	/*
	   If the uri is relative then build it.
	*/

	if strings.Index(uri, "://") == -1 {
		if uri[:1] == "." {
			// relative to path
			path := req.OriginalUrl
			if i := strings.Index(path, "?"); i > 0 {
				path = path[:i]
			}
			i := strings.Index(path, "://") + 2
			uri = path[:i] + filepath.Join(path[i:], uri)
		} else if uri[:1] != "/" {
			// relative to mount-point
			uri = filepath.Join(app.Path(), uri)
		}
	}

	this.Set("Location", uri)
}