cost

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GroupBy

func GroupBy(c []AccountCost) (map[string][]AccountCost, []string)

func Serialize

func Serialize(dir string, date []calendar.Date, metrics []string) error

func SortedKey

func SortedKey(group map[string][]AccountCost) []string

Types

type AccountCost

type AccountCost struct {
	AccountID        string `json:"account_id"`
	Description      string `json:"description"`
	Date             string `json:"date,omitempty"`
	Service          string `json:"service,omitempty"`
	RecordType       string `json:"record_type,omitempty"`
	UnblendedCost    Cost   `json:"unblended_cost"`     // volume discount for a single account
	BlendedCost      Cost   `json:"blended_cost"`       // volume discount across linked account
	AmortizedCost    Cost   `json:"amortized_cost"`     // unblended + ReservedInstances/12
	NetAmortizedCost Cost   `json:"net_amortized_cost"` // before discount
	NetUnblendedCost Cost   `json:"net_unblended_cost"` // before discount
}

func Deserialize

func Deserialize(dir string, date []calendar.Date) ([]AccountCost, error)

func Fetch

func Fetch(start, end string, metrics []string) ([]AccountCost, error)

func FetchWith

func FetchWith(start, end string, dim, met []string) ([]AccountCost, error)

func (AccountCost) JSON

func (a AccountCost) JSON() string

func (AccountCost) Pretty

func (a AccountCost) Pretty() string

func (AccountCost) String

func (a AccountCost) String() string

type Cost

type Cost struct {
	Amount string `json:"amount"`
	Unit   string `json:"unit"`
}

Jump to

Keyboard shortcuts

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