Documentation ¶
Overview ¶
Package flavors provides information and interaction with the flavors API resource in the OpenStack CDN service. This API resource allows for listing flavors and retrieving a specific flavor.
A flavor is a mapping configuration to a CDN provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleGetCDNFlavorSuccessfully ¶
HandleGetCDNFlavorSuccessfully creates an HTTP handler at `/flavors/{id}` on the test handler mux that responds with a `Get` response.
func HandleListCDNFlavorsSuccessfully ¶
HandleListCDNFlavorsSuccessfully creates an HTTP handler at `/flavors` on the test handler mux that responds with a `List` response.
func List ¶
func List(c *gophercloud.ServiceClient) pagination.Pager
List returns a single page of CDN flavors.
Types ¶
type Flavor ¶
type Flavor struct { // Specifies the name of the flavor. The name must not exceed 64 bytes in // length and is limited to unicode, digits, underscores, and hyphens. ID string `mapstructure:"id"` // Specifies the list of providers mapped to this flavor. Providers []Provider `mapstructure:"providers"` // Specifies the self-navigating JSON document paths. Links []gophercloud.Link `mapstructure:"links"` }
Flavor represents a mapping configuration to a CDN provider.
func ExtractFlavors ¶
func ExtractFlavors(page pagination.Page) ([]Flavor, error)
ExtractFlavors extracts and returns Flavors. It is used while iterating over a flavors.List call.
type FlavorPage ¶
type FlavorPage struct {
pagination.SinglePageBase
}
FlavorPage is the page returned by a pager when traversing over a collection of CDN flavors.
func (FlavorPage) IsEmpty ¶
func (r FlavorPage) IsEmpty() (bool, error)
IsEmpty returns true if a FlavorPage contains no Flavors.
type GetResult ¶
type GetResult struct {
gophercloud.Result
}
GetResult represents the result of a get operation.
func Get ¶
func Get(c *gophercloud.ServiceClient, id string) GetResult
Get retrieves a specific flavor based on its unique ID.
type Provider ¶
type Provider struct { // Specifies the name of the provider. The name must not exceed 64 bytes in // length and is limited to unicode, digits, underscores, and hyphens. Provider string `mapstructure:"provider"` // Specifies a list with an href where rel is provider_url. Links []gophercloud.Link `mapstructure:"links"` }
Provider represents a provider for a particular flavor.