func()

in gcloud/cloudfunctions.go [48:72]


func (c *Client) FunctionRegionList(project string) ([]string, error) {
	resp := []string{}

	if err := c.ServiceEnable(project, CloudFunctions); err != nil {
		return resp, fmt.Errorf("error activating service for polling: %s", err)
	}

	svc, err := c.getCloudFunctionsService(project)
	if err != nil {
		return resp, err
	}

	results, err := svc.Projects.Locations.List("projects/" + project).Do()
	if err != nil {
		return resp, err
	}

	for _, v := range results.Locations {
		resp = append(resp, v.LocationId)
	}

	sort.Strings(resp)

	return resp, nil
}