costing

package
v0.0.0-...-d74374d Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractCostingsInto

func ExtractCostingsInto(r pagination.Page, v interface{}) error

func ListCluster

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

func ListDomains

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

func ListObjects

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

func ListProjects

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

Types

type Costing

type Costing struct {
	Year           int     `json:"year"`
	Month          int     `json:"month"`
	Region         string  `json:"region"`
	ProjectID      string  `json:"project_id"`
	ObjectID       string  `json:"object_id"`
	CostObject     string  `json:"cost_object"`
	CostObjectType string  `json:"cost_object_type"`
	COInherited    bool    `json:"co_inherited"`
	AllocationType string  `json:"allocation_type"`
	Service        string  `json:"service"`
	Measure        string  `json:"measure"`
	Amount         float64 `json:"amount"`
	AmountUnit     string  `json:"amount_unit"`
	Duration       float64 `json:"duration"`
	DurationUnit   string  `json:"duration_unit"`
	PriceLoc       float64 `json:"price_loc"`
	PriceSec       float64 `json:"price_sec"`
	Currency       string  `json:"currency"`
}

Costing represents a Costing Costing.

func ExtractCostings

func ExtractCostings(r pagination.Page) ([]Costing, error)

ExtractCostings accepts a Page struct, specifically a CostingPage struct, and extracts the elements into a slice of Costing structs. In other words, a generic collection is mapped into a relevant slice.

type CostingPage

type CostingPage struct {
	pagination.SinglePageBase
}

CostingPage is the page returned by a pager when traversing over a collection of costing.

type ListOpts

type ListOpts struct {
	CostObject        string    `q:"cost_object"`
	ProjectID         string    `q:"project_id"`
	DomainID          string    `q:"domain_id"`
	Service           string    `q:"service"`
	Measure           string    `q:"measure"`
	ExcludeInternalCO bool      `q:"exclude_internal_co"`
	Format            string    `q:"format"`
	Language          string    `q:"language"`
	Last              int       `q:"last"`
	Start             time.Time `q:"-"`
	End               time.Time `q:"-"`
}

ListOpts is a structure that holds options for listing costings.

func (ListOpts) ToCostingListQuery

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

ToCostingListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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