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 List(c *gophercloud.ServiceClient, opts os.ListOptsBuilder) pagination.Pager
 - type EnableHeader
 - type EnableOpts
 - type EnableOptsBuilder
 - type EnableResult
 - type GetHeader
 - type GetResult
 - type ListOpts
 - type State
 - type UpdateHeader
 - type UpdateOpts
 - type UpdateOptsBuilder
 - type UpdateResult
 
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 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.
Types ¶
type EnableHeader ¶ added in v0.11.0
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 ¶
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 an Enable operation.
func Enable ¶
func Enable(c *gophercloud.ServiceClient, containerName string, opts EnableOptsBuilder) EnableResult
Enable is a function that enables/disables a CDN container.
func (EnableResult) Extract ¶ added in v0.11.0
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 ¶ added in v0.11.0
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 ¶ added in v0.11.0
type GetResult struct {
	gophercloud.HeaderResult
}
    GetResult represents the result of a Get operation.
func Get ¶
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.
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 State ¶ added in v0.11.0
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.
type UpdateHeader ¶ added in v0.11.0
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 ¶
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 ¶
func (opts UpdateOpts) ToContainerUpdateMap() (map[string]string, error)
ToContainerUpdateMap formats a CreateOpts into a map of headers.
type UpdateOptsBuilder ¶ added in v0.11.0
UpdateOptsBuilder allows extensions to add additional parameters to the Update request.
type UpdateResult ¶ added in v0.11.0
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 ¶
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 ¶ added in v0.11.0
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.