cdncontainers

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2015 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package cdncontainers provides information and interaction with the CDN Container API resource for the Rackspace Cloud Files service.

Index

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

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

type EnableOptsBuilder interface {
	ToCDNContainerEnableMap() (map[string]string, error)
}

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.

func (ListOpts) ToContainerListParams

func (opts ListOpts) ToContainerListParams() (bool, string, error)

ToContainerListParams formats a ListOpts into a query string and boolean representing whether to list complete information for each container.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL