Jon Perritt | fd53bba | 2014-10-03 00:41:22 -0500 | [diff] [blame] | 1 | package apiversions |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
Marcin Krolik | 14c8801 | 2016-02-16 08:59:48 +0100 | [diff] [blame] | 5 | "net/url" |
Jon Perritt | fd53bba | 2014-10-03 00:41:22 -0500 | [diff] [blame] | 6 | |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame] | 7 | "github.com/gophercloud/gophercloud" |
Jon Perritt | fd53bba | 2014-10-03 00:41:22 -0500 | [diff] [blame] | 8 | ) |
| 9 | |
| 10 | func getURL(c *gophercloud.ServiceClient, version string) string { |
| 11 | return c.ServiceURL(strings.TrimRight(version, "/") + "/") |
| 12 | } |
| 13 | |
| 14 | func listURL(c *gophercloud.ServiceClient) string { |
Marcin Krolik | 14c8801 | 2016-02-16 08:59:48 +0100 | [diff] [blame] | 15 | u, _ := url.Parse(c.ServiceURL("")) |
| 16 | u.Path = "/" |
| 17 | return u.String() |
Jon Perritt | fd53bba | 2014-10-03 00:41:22 -0500 | [diff] [blame] | 18 | } |