flavors

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2015 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

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

func HandleGetCDNFlavorSuccessfully(t *testing.T)

HandleGetCDNFlavorSuccessfully creates an HTTP handler at `/flavors/{id}` on the test handler mux that responds with a `Get` response.

func HandleListCDNFlavorsSuccessfully

func HandleListCDNFlavorsSuccessfully(t *testing.T)

HandleListCDNFlavorsSuccessfully creates an HTTP handler at `/flavors` on the test handler mux that responds with a `List` response.

func List

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

Get retrieves a specific flavor based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Flavor, error)

Extract is a function that extracts a flavor from a GetResult.

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.

Jump to

Keyboard shortcuts

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