Documentation ¶
Index ¶
- func DescriptionFilter(skus []*billingpb.Sku, contains, omits []string) ([]*billingpb.Sku, error)
- func GetSKUs(ctx context.Context, service string) ([]*billingpb.Sku, error)
- func PricingInfo(sku *billingpb.Sku, ...) (usageUnit string, pricePerUnit float64, currencyType string)
- func RegionFilter(skus []*billingpb.Sku, region string) ([]*billingpb.Sku, error)
- type ComputeEngineCatalog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescriptionFilter ¶
DescriptionFilter returns the SKUs that meet the description requirements.
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.
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.
Click to show internal directories.
Click to hide internal directories.