gophercloud: github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers Index | Files

package cdncontainers

import "github.com/rackspace/gophercloud/rackspace/objectstorage/v1/cdncontainers"

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

Index

Package Files

delegate.go doc.go requests.go results.go urls.go

func ExtractNames Uses

func ExtractNames(page pagination.Page) ([]string, error)

ExtractNames interprets a page of List results when just the container names are requested.

func List Uses

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.

type EnableHeader Uses

type EnableHeader struct {
    CDNIosURI       string    `mapstructure:"X-Cdn-Ios-Uri"`
    CDNSslURI       string    `mapstructure:"X-Cdn-Ssl-Uri"`
    CDNStreamingURI string    `mapstructure:"X-Cdn-Streaming-Uri"`
    CDNUri          string    `mapstructure:"X-Cdn-Uri"`
    ContentLength   int       `mapstructure:"Content-Length"`
    ContentType     string    `mapstructure:"Content-Type"`
    Date            time.Time `mapstructure:"-"`
    TransID         string    `mapstructure:"X-Trans-Id"`
}

EnableHeader represents the headers returned in the response from an Enable request.

type EnableOpts Uses

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 Uses

func (opts EnableOpts) ToCDNContainerEnableMap() (map[string]string, error)

ToCDNContainerEnableMap formats an EnableOpts into a map of headers.

type EnableOptsBuilder Uses

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

EnableOptsBuilder allows extensions to add additional parameters to the Enable request.

type EnableResult Uses

type EnableResult struct {
    gophercloud.HeaderResult
}

EnableResult represents the result of an Enable operation.

func Enable Uses

func Enable(c *gophercloud.ServiceClient, containerName string, opts EnableOptsBuilder) EnableResult

Enable is a function that enables/disables a CDN container.

func (EnableResult) Extract Uses

func (er EnableResult) Extract() (EnableHeader, error)

Extract will return extract an EnableHeader from the response to an Enable request. To obtain a map of headers, call the ExtractHeader method on the EnableResult.

type GetHeader Uses

type GetHeader struct {
    CDNEnabled      bool      `mapstructure:"X-Cdn-Enabled"`
    CDNIosURI       string    `mapstructure:"X-Cdn-Ios-Uri"`
    CDNSslURI       string    `mapstructure:"X-Cdn-Ssl-Uri"`
    CDNStreamingURI string    `mapstructure:"X-Cdn-Streaming-Uri"`
    CDNUri          string    `mapstructure:"X-Cdn-Uri"`
    ContentLength   int       `mapstructure:"Content-Length"`
    ContentType     string    `mapstructure:"Content-Type"`
    Date            time.Time `mapstructure:"-"`
    LogRetention    bool      `mapstructure:"X-Log-Retention"`
    TransID         string    `mapstructure:"X-Trans-Id"`
    TTL             int       `mapstructure:"X-Ttl"`
}

GetHeader represents the headers returned in the response from a Get request.

type GetResult Uses

type GetResult struct {
    gophercloud.HeaderResult
}

GetResult represents the result of a Get operation.

func Get Uses

func Get(c *gophercloud.ServiceClient, containerName string) 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 (GetResult) Extract Uses

func (gr GetResult) Extract() (GetHeader, error)

Extract will return a struct of headers returned from a call to Get. To obtain a map of headers, call the ExtractHeader method on the GetResult.

func (GetResult) ExtractMetadata Uses

func (gr GetResult) ExtractMetadata() (map[string]string, error)

ExtractMetadata is a function that takes a GetResult (of type *http.Response) and returns the custom metadata associated with the container.

type ListOpts Uses

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 Uses

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 State Uses

type State *bool

State is the state of an option. It is a pointer to a boolean to enable checking for a zero-value of nil instead of false, which is a valid option.

var (

    // Enabled is used for a true value for options in request bodies.
    Enabled State = &iTrue
    // Disabled is used for a false value for options in request bodies.
    Disabled State = &iFalse
)

type UpdateHeader Uses

type UpdateHeader struct {
    CDNIosURI       string    `mapstructure:"X-Cdn-Ios-Uri"`
    CDNSslURI       string    `mapstructure:"X-Cdn-Ssl-Uri"`
    CDNStreamingURI string    `mapstructure:"X-Cdn-Streaming-Uri"`
    CDNUri          string    `mapstructure:"X-Cdn-Uri"`
    ContentLength   int       `mapstructure:"Content-Length"`
    ContentType     string    `mapstructure:"Content-Type"`
    Date            time.Time `mapstructure:"-"`
    TransID         string    `mapstructure:"X-Trans-Id"`
}

UpdateHeader represents the headers returned in the response from a Update request.

type UpdateOpts Uses

type UpdateOpts struct {
    // Whether or not to CDN-enable a container. Prefer using XCDNEnabled, which
    // is of type *bool underneath.
    // TODO v2.0: change type to Enabled/Disabled (*bool)
    CDNEnabled bool `h:"X-Cdn-Enabled"`
    // Whether or not to enable log retention. Prefer using XLogRetention, which
    // is of type *bool underneath.
    // TODO v2.0: change type to Enabled/Disabled (*bool)
    LogRetention  bool `h:"X-Log-Retention"`
    XCDNEnabled   *bool
    XLogRetention *bool
    TTL           int `h:"X-Ttl"`
}

UpdateOpts is a structure that holds parameters for updating, creating, or deleting a container's metadata.

func (UpdateOpts) ToContainerUpdateMap Uses

func (opts UpdateOpts) ToContainerUpdateMap() (map[string]string, error)

ToContainerUpdateMap formats a CreateOpts into a map of headers.

type UpdateOptsBuilder Uses

type UpdateOptsBuilder interface {
    ToContainerUpdateMap() (map[string]string, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult Uses

type UpdateResult struct {
    gophercloud.HeaderResult
}

UpdateResult represents the result of an update operation. To extract the the headers from the HTTP response, you can invoke the 'ExtractHeader' method on the result struct.

func Update Uses

func Update(c *gophercloud.ServiceClient, containerName string, opts UpdateOptsBuilder) UpdateResult

Update is a function that creates, updates, or deletes a container's metadata.

func (UpdateResult) Extract Uses

func (ur UpdateResult) Extract() (UpdateHeader, error)

Extract will return a struct of headers returned from a call to Update. To obtain a map of headers, call the ExtractHeader method on the UpdateResult.

Package cdncontainers imports 6 packages (graph) and is imported by 1 packages. Updated 2016-07-19. Refresh now. Tools for package owners.