Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFlavorsInto ¶
func ExtractFlavorsInto(r pagination.Page, v interface{}) error
func List ¶
func List(c *gcorecloud.ServiceClient) pagination.Pager
Types ¶
type Flavor ¶
type Flavor struct { PricePerMonth float64 `json:"price_per_month,omitempty"` ResourceClass string `json:"resource_class,omitempty"` VCPUs int `json:"vcpus,omitempty"` FlavorName string `json:"flavor_name,omitempty"` HardwareDescription HardwareDescription `json:"hardware_description"` CurrencyCode string `json:"currency_code,omitempty"` PriceStatus string `json:"price_status,omitempty"` PricePerHour float64 `json:"price_per_hour,omitempty"` RAM int `json:"ram,omitempty"` FlavorID string `json:"flavor_id,omitempty"` }
Flavor represent loadbalancer's flavor structure
func ExtractFlavors ¶
func ExtractFlavors(r pagination.Page) ([]Flavor, error)
ExtractFlavors accepts a Page struct, specifically a FlavorPage struct, and extracts the elements into a slice of Flavor structs. In other words, a generic collection is mapped into a relevant slice.
func ListAll ¶
func ListAll(c *gcorecloud.ServiceClient) ([]Flavor, error)
ListAll returns all LB flavors
type FlavorPage ¶
type FlavorPage struct {
pagination.LinkedPageBase
}
FlavorPage is the page returned by a pager when traversing over a collection of loadbalancer flavors.
func (FlavorPage) IsEmpty ¶
func (r FlavorPage) IsEmpty() (bool, error)
IsEmpty checks whether a FlavorPage struct is empty.
func (FlavorPage) NextPageURL ¶
func (r FlavorPage) NextPageURL() (string, error)
NextPageURL is invoked when a paginated collection of loadbalancer flavors has reached the end of a page and the pager seeks to traverse over a new one. In order to do this, it needs to construct the next page's URL.
type HardwareDescription ¶
type HardwareDescription struct { SGXEPCSize string `json:"sgx_epc_size"` CPU string `json:"cpu"` Disk string `json:"disk"` Network string `json:"network"` GPU string `json:"gpu"` RAM string `json:"ram"` }
HardwareDescription represent flavor's hardware description structure