blob: 540e0cd298a074036735bec624b33337bc27590d [file] [log] [blame]
Jon Perritt65c81ec2015-02-16 11:07:11 -07001package cdnobjects
2
3import (
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.
9func 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}