urls.go 413 B

123456789101112131415161718192021
  1. package apiversions
  2. import (
  3. "net/url"
  4. "strings"
  5. "devel.mephi.ru/iacherepanov/openstack-gophercloud"
  6. )
  7. func getURL(c *gophercloud.ServiceClient, version string) string {
  8. u, _ := url.Parse(c.ServiceURL(""))
  9. u.Path = "/" + strings.TrimRight(version, "/") + "/"
  10. return u.String()
  11. }
  12. func listURL(c *gophercloud.ServiceClient) string {
  13. u, _ := url.Parse(c.ServiceURL(""))
  14. u.Path = "/"
  15. return u.String()
  16. }