// getLocation will get the location details for where this
// application has been run from.
505152
func getLocation() (*Data, error) {
	response, err := http.Get(URL)
	if err != nil {
		return nil, err
	}
	defer response.Body.Close()
	r := &Data{}
	if err = json.NewDecoder(response.Body).Decode(&r); err != nil {
		return nil, err
	}
	return r, nil
}
1213210
func (s *EndpointResponse) SetLocation(v *EndpointLocation) *EndpointResponse {
	s.Location = v
	return s
}
957494
func (s *CreateHealthCheckOutput) SetLocation(v string) *CreateHealthCheckOutput {
	s.Location = &v
	return s
}
371231
func (s *Interconnect) SetLocation(v string) *Interconnect {
	s.Location = &v
	return s
}
154924
func (s *CreateIPSetInput) SetLocation(v string) *CreateIPSetInput {
	s.Location = &v
	return s
}
603100
func (extr *ContentExtractor) GetMetaContentLocation(document *goquery.Document) string {
	return extr.GetMetaContent(document, "contentLocation")
}
1045970
func (c *locationCache) getLocation(offset int) *time.Location {
	c.lock.Lock()
	defer c.lock.Unlock()

	location, ok := c.cache[offset]
	if !ok {
		location = time.FixedZone("", offset)
		c.cache[offset] = location
	}

	return location
}
450540
func (s *PostCommentForPullRequestOutput) SetLocation(v *Location) *PostCommentForPullRequestOutput {
	s.Location = v
	return s
}
663839
func (s *Connection) SetLocation(v string) *Connection {
	s.Location = &v
	return s
}
151441
func (c Client) GetBucketLocation(bucketName string) (string, error) {
	if err := s3utils.CheckValidBucketName(bucketName); err != nil {
		return "", err
	}
	return c.getBucketLocation(bucketName)
}
1009859
func (s *CreateVaultOutput) SetLocation(v string) *CreateVaultOutput {
	s.Location = &v
	return s
}
1054035
func GetLocation(n ast.Node, ctx *Context) (string, int) {
	fobj := ctx.FileSet.File(n.Pos())
	return fobj.Name(), fobj.Line(n.Pos())
}
209096
func (s *InitiateMultipartUploadOutput) SetLocation(v string) *InitiateMultipartUploadOutput {
	s.Location = &v
	return s
}
47874
func getLocation(resp *http.Response) string {
	if resp == nil {
		return ""
	}

	return resp.Header.Get("Location")
}
964965
func (s *StorageDescriptor) SetLocation(v string) *StorageDescriptor {
	s.Location = &v
	return s
}
585863
func (s *ProjectCache) SetLocation(v string) *ProjectCache {
	s.Location = &v
	return s
}
31536
func (c *Client) GetLocationByID(id string) (common.Location, error) {
	location, err := c.protocol.GetLocation(id)
	if err == nil {
		return location, nil
	}

	var timeout <-chan time.Time
	if c.timeout > 0 {
		timeout = time.After(c.timeout)
	} else {
		timeout = make(<-chan time.Time)
	}

	sub := c.protocol.Subscribe()
	defer func() {
		if err = sub.Close(); err != nil {
			common.Log.Warnf("Failed closing location subscription: %+v", err)
		}
	}()
	events := sub.Events()

	for {
		select {
		case event, ok := <-events:
			if !ok {
				return nil, common.ErrClosed
			}
			switch event := event.(type) {
			case common.EventNewLocation:
				if id == event.Location.ID() {
					return event.Location, nil
				}
			}
		case <-timeout:
			return nil, common.ErrNotFound
		}
	}
}