flavors

package
v0.5.28 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List returns a Pager which allows you to iterate over a collection of flavors.

Types

type Flavor

type Flavor struct {
	// Specifies the ID of the flavor.
	ID string `json:"id"`

	// Specifies the info of the flavor.
	Info FlavorInfo `json:"info"`

	// Specifies the name of the flavor.
	Name string `json:"name"`

	// Specifies whether shared.
	Shared bool `json:"shared"`

	// Specifies the type of the flavor.
	Type string `json:"type"`

	// Specifies whether sold out.
	SoldOut bool `json:"flavor_sold_out"`
}

func ExtractFlavors

func ExtractFlavors(r pagination.Page) ([]Flavor, error)

ExtractFlavors accepts a Page struct, specifically a FlavorsPage struct, and extracts the elements into a slice of flavor structs. In other words, a generic collection is mapped into a relevant slice.

type FlavorInfo

type FlavorInfo struct {
	// Specifies the connection
	Connection int `json:"connection"`

	// Specifies the cps.
	Cps int `json:"cps"`

	// Specifies the qps
	Qps int `json:"qps"`

	// Specifies the https_cps
	HttpsCps int `json:"https_cps"`

	// Specifies the lcu
	Lcu int `json:"lcu"`

	// Specifies the bandwidth
	Bandwidth int `json:"bandwidth"`
}

type FlavorPage

type FlavorPage struct {
	pagination.PageWithInfo
}

FlavorPage is the page returned by a pager when traversing over a collection of flavor.

func (FlavorPage) IsEmpty

func (r FlavorPage) IsEmpty() (bool, error)

IsEmpty checks whether a FlavorsPage struct is empty.

type GetResult

type GetResult struct {
	golangsdk.Result
}

func Get

func Get(client *golangsdk.ServiceClient, flavorID string) (r GetResult)

Get returns additional information about a Flavor, given its ID.

func (GetResult) Extract

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

type ListOpts

type ListOpts struct {
	// Specifies the id.
	ID []string `q:"id"`
	// Specifies the name.
	Name []string `q:"name"`
	// Specifies whether shared.
	Shared *bool `q:"shared"`
	// Specifies the type.
	Type []string `q:"type"`
}

ListOpts allows the filtering and sorting of paginated collections through the API.

func (ListOpts) ToFlavorListMap

func (opts ListOpts) ToFlavorListMap() (string, error)

ToFlavorListMap formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToFlavorListMap() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

Jump to

Keyboard shortcuts

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