flavors

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 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 bandwidth
	Bandwidth int `json:"bandwidth"`
}

type FlavorsPage

type FlavorsPage struct {
	pagination.LinkedPageBase
}

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

func (FlavorsPage) IsEmpty

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

IsEmpty checks whether a FlavorsPage struct is empty.

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