billing

package
v0.0.0-...-7bdeeeb Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescriptionFilter

func DescriptionFilter(skus []*billingpb.Sku, contains, omits []string) ([]*billingpb.Sku, error)

DescriptionFilter returns the SKUs that meet the description requirements.

func GetSKUs

func GetSKUs(ctx context.Context, service string) ([]*billingpb.Sku, error)

GetSKUs returns the SKUs from the billing API for the specific service or an error.

func PricingInfo

func PricingInfo(sku *billingpb.Sku, correctTieredRate func(*billingpb.PricingExpression_TierRate) bool) (usageUnit string,
	pricePerUnit float64, currencyType string)

PricingInfo returns the pricing information of an SKU.

func RegionFilter

func RegionFilter(skus []*billingpb.Sku, region string) ([]*billingpb.Sku, error)

RegionFilter returns the SKUs from the specified region.

Types

type ComputeEngineCatalog

type ComputeEngineCatalog struct {
	// contains filtered or unexported fields
}

ComputeEngineCatalog holds the information from the billing catalog for Compute Engine SKUs.

func NewComputeEngineCatalog

func NewComputeEngineCatalog(ctx context.Context) (*ComputeEngineCatalog, error)

NewComputeEngineCatalog creates a catalog instance, calls the billing API and stores its response. Core and RAM instances are stored by usage type. Disks are stored by resource group.

func (*ComputeEngineCatalog) DiskSKUs

func (catalog *ComputeEngineCatalog) DiskSKUs(diskType string) ([]*billingpb.Sku, error)

DiskSKUs returns the SKUs matching the resource group of the specified disk type.

func (*ComputeEngineCatalog) GetCoreSKUs

func (catalog *ComputeEngineCatalog) GetCoreSKUs(usageType string) ([]*billingpb.Sku, error)

GetCoreSKUs returns the Core Instance SKUs from the billing API.

func (*ComputeEngineCatalog) GetRAMSKUs

func (catalog *ComputeEngineCatalog) GetRAMSKUs(usageType string) ([]*billingpb.Sku, error)

GetRAMSKUs returns the Ram Instance SKUs from the billing API.

Jump to

Keyboard shortcuts

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