// AccountURL returns the URL to an account of an importer
// (http://host/importer/TYPE/sha1-sd8fsd7f8sdf7).
552094
func (sc *SetupContext) AccountURL() string {
	return sc.Host.ImporterBaseURL() + sc.ia.im.name + "/" + sc.AccountNode.PermanodeRef().String()
}
605654
func (s *Server) URL() (u *url.URL, err error) {
	if s.Scheme == "" {
		return u, fmt.Errorf("Server %s:%d has no scheme, cannot make a URL", s.Host, s.Port)
	}

	ustring := fmt.Sprintf("%s://%s:%d", s.Scheme, s.Host, s.Port)

	u, err = url.Parse(ustring)
	if err != nil {
		return u, fmt.Errorf("Could not parse %s: %s", ustring, err)
	}

	return
}
560259
func (i *item) URL() *url.URL {
	if i.container.customEndpoint == "" {
		genericURL := fmt.Sprintf("https://s3-%s.amazonaws.com/%s/%s", i.container.Region(), i.container.Name(), i.Name())

		return &url.URL{
			Scheme: "s3",
			Path:   genericURL,
		}
	}

	genericURL := fmt.Sprintf("%s/%s", i.container.Name(), i.Name())
	return &url.URL{
		Scheme: "s3",
		Path:   genericURL,
	}
}
660868
func CopyURL(i *url.URL) *url.URL {
	out := *i
	if i.User != nil {
		out.User = &(*i.User)
	}
	return &out
}
186475
func (m UsersAPIAuthMethod) LoginURL(c context.Context, dest string) (string, error) {
	url, err := user.LoginURL(c, dest)
	if err != nil {
		return "", err
	}
	if !strings.HasPrefix(url, serviceLoginURL) {
		if !info.IsDevAppServer(c) {
			logging.Warningf(c, "Unexpected login URL: %q", url)
		}
		return url, nil
	}
	// Give the user a choice of existing accounts in their session or the option
	// to add an account, even if they are currently signed in to exactly one
	// account.
	return accountChooserURL + url[len(serviceLoginURL):], nil
}
454070
func (reader *PluginConfigReader) GetURL(key string, defaultValue string) *url.URL {
	value, err := reader.WithError.GetURL(key, defaultValue)
	reader.Errors.Push(err)
	return value
}
1337406
func (s accountService) Account() (*Account, error) {
	var account Account
	req, err := s.client.NewRequest("GET", accountBasePath, nil)
	if err != nil {
		return nil, err
	}
	err = s.client.Do(req, &account)
	if err != nil {
		return nil, err
	}

	return &account, nil
}
224447
func (s *AliasesService) buildURL() (string, url.Values, error) {
	var err error
	var path string

	if len(s.index) > 0 {
		path, err = uritemplates.Expand("/{index}/_alias/{alias}", map[string]string{
			"index": strings.Join(s.index, ","),
			"alias": strings.Join(s.alias, ","),
		})
	} else {
		path, err = uritemplates.Expand("/_alias/{alias}", map[string]string{
			"alias": strings.Join(s.alias, ","),
		})
	}
	if err != nil {
		return "", url.Values{}, err
	}
	path = strings.TrimSuffix(path, "/")

	// Add query string parameters
	params := url.Values{}
	if s.pretty {
		params.Set("pretty", fmt.Sprintf("%v", s.pretty))
	}
	return path, params, nil
}
520705
func (s *SourceImportAuthor) GetImportURL() string {
	if s == nil || s.ImportURL == nil {
		return ""
	}
	return *s.ImportURL
}
752763
func (c *Client) authURL(path string) string {
	return authURL2 + c.appID + path
}
809138
func (c *Client) DecodeAccountLink(resp *http.Response) (*AccountLink, error) {
	var decoded AccountLink
	err := c.Decoder.Decode(&decoded, resp.Body, resp.Header.Get("Content-Type"))
	return &decoded, err
}
994912
func (s *StorageClient) SignURL(input *SignURLInput) (*SignURLOutput, error) {
	output := &SignURLOutput{
		host:       s.Client.MantaURL.Host,
		objectPath: fmt.Sprintf("/%s%s", s.Client.AccountName, input.ObjectPath),
		Method:     input.Method,
		Algorithm:  strings.ToUpper(s.Client.Authorizers[0].DefaultAlgorithm()),
		Expires:    strconv.FormatInt(time.Now().Add(input.ValidityPeriod).Unix(), 10),
		KeyID:      path.Join("/", s.Client.AccountName, "keys", s.Client.Authorizers[0].KeyFingerprint()),
	}

	toSign := bytes.Buffer{}
	toSign.WriteString(input.Method + "\n")
	toSign.WriteString(s.Client.MantaURL.Host + "\n")
	toSign.WriteString(fmt.Sprintf("/%s%s\n", s.Client.AccountName, input.ObjectPath))

	query := &url.Values{}
	query.Set("algorithm", output.Algorithm)
	query.Set("expires", output.Expires)
	query.Set("keyId", output.KeyID)
	toSign.WriteString(query.Encode())

	signature, _, err := s.Client.Authorizers[0].SignRaw(toSign.String())
	if err != nil {
		return nil, errors.Wrapf(err, "error signing string")
	}

	output.Signature = signature
	return output, nil
}
533680
func (s *AccountsService) Find(k AccountKey) (Account, *http.Response, error) {
	var t Account
	res, err := s.client.get(k.URI(), &t)
	return t, res, err
}
755341
func (c *Client) RegistrationURL(r Registration) (string, error) {
	err := r.IsValid()
	if err != nil {
		return "", err
	}

	u, _ := url.Parse(c.URL)
	u.Path = "/start"

	q := u.Query()
	q.Set("cluster_id", r.ClusterID)
	q.Set("product", r.Product)
	if r.RedirectURL != "" {
		q.Set("redirect_url", r.RedirectURL)
	}
	u.RawQuery = q.Encode()

	return u.String(), nil
}
555208
func (m *AuthMethod) LoginURL(c context.Context, dest string) (string, error) {
	if m.SessionStore == nil {
		return "", ErrNotConfigured
	}
	return makeRedirectURL(loginURL, dest)
}
1233470
func copyURL(i *url.URL) *url.URL {
	out := *i
	if i.User != nil {
		out.User = &(*i.User)
	}
	return &out
}
1137244
func URL(addr string) ClientOpt {
	return func(c *Client) {
		if addr == "" {
			addr = "amqp://guest:guest@localhost/"
		}
		c.addr = addr
	}
}