Documentation
¶
Overview ¶
Package cdncontainers provides information and interaction with the CDN Container API resource for the Rackspace Cloud Files service.
Index ¶
- func ExtractNames(page pagination.Page) ([]string, error)
- func Get(c *gophercloud.ServiceClient, containerName string) os.GetResult
- func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager
- func Update(c *gophercloud.ServiceClient, containerName string, opts os.UpdateOptsBuilder) os.UpdateResult
- type EnableOpts
- type EnableOptsBuilder
- type EnableResult
- type ListOpts
- type UpdateOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractNames ¶
func ExtractNames(page pagination.Page) ([]string, error)
ExtractNames interprets a page of List results when just the container names are requested.
func Get ¶
func Get(c *gophercloud.ServiceClient, containerName string) os.GetResult
Get is a function that retrieves the metadata of a container. To extract just the custom metadata, pass the GetResult response to the ExtractMetadata function.
func List ¶
func List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager
List is a function that retrieves containers associated with the account as well as account metadata. It returns a pager which can be iterated with the EachPage function.
func Update ¶
func Update(c *gophercloud.ServiceClient, containerName string, opts os.UpdateOptsBuilder) os.UpdateResult
Update is a function that creates, updates, or deletes a container's metadata.
Types ¶
type EnableOpts ¶
type EnableOpts struct {
// CDNEnabled indicates whether or not the container is CDN enabled. Set to
// `true` to enable the container. Note that changing this setting from true
// to false will disable the container in the CDN but only after the TTL has
// expired.
CDNEnabled bool `h:"X-Cdn-Enabled"`
// TTL is the time-to-live for the container (in seconds).
TTL int `h:"X-Ttl"`
}
EnableOpts is a structure that holds options for enabling a CDN container.
func (EnableOpts) ToCDNContainerEnableMap ¶
func (opts EnableOpts) ToCDNContainerEnableMap() (map[string]string, error)
ToCDNContainerEnableMap formats an EnableOpts into a map of headers.
type EnableOptsBuilder ¶
EnableOptsBuilder allows extensions to add additional parameters to the Enable request.
type EnableResult ¶
type EnableResult struct {
gophercloud.HeaderResult
}
EnableResult represents the result of a get operation.
func Enable ¶
func Enable(c *gophercloud.ServiceClient, containerName string, opts EnableOptsBuilder) EnableResult
Enable is a function that enables/disables a CDN container.
type ListOpts ¶
type ListOpts struct {
EndMarker string `q:"end_marker"`
Format string `q:"format"`
Limit int `q:"limit"`
Marker string `q:"marker"`
}
ListOpts are options for listing Rackspace CDN containers.
type UpdateOpts ¶
type UpdateOpts struct {
CDNEnabled bool `h:"X-Cdn-Enabled"`
LogRetention bool `h:"X-Log-Retention"`
TTL int `h:"X-Ttl"`
}
UpdateOpts is a structure that holds parameters for updating, creating, or deleting a container's metadata.
func (UpdateOpts) ToContainerUpdateMap ¶
func (opts UpdateOpts) ToContainerUpdateMap() (map[string]string, error)
ToContainerUpdateMap formats a CreateOpts into a map of headers.