Jon Perritt | 65c81ec | 2015-02-16 11:07:11 -0700 | [diff] [blame] | 1 | package cdnobjects |
| 2 | |
| 3 | import ( |
| 4 | "github.com/rackspace/gophercloud" |
| 5 | "github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers" |
| 6 | ) |
| 7 | |
| 8 | // CDNURL returns the unique CDN URI for the given container and object. |
| 9 | func CDNURL(c *gophercloud.ServiceClient, containerName, objectName string) (string, error) { |
| 10 | h, err := cdncontainers.Get(c, containerName).Extract() |
| 11 | if err != nil { |
| 12 | return "", err |
| 13 | } |
| 14 | return h.CDNUri + "/" + objectName, nil |
| 15 | } |