compute

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FamilyG1 Identification for G1 Small instances Family.
	FamilyG1 = "g1"
	// FamilyF1 Identification for F1 Micro instances Family.
	FamilyF1 = "f1"
	// FamilyN1 Identification for N1 instances Family.
	FamilyN1 = "n1"
	// FamilyN2 Identification for N2 instances Family.
	FamilyN2 = "n2"
	// FamilyN2D Identification for N2D instances Family.
	FamilyN2D = "n2d"
	// FamilyE2 Identification for E2 instances Family.
	FamilyE2 = "e2"
	// FamilyC2 Identification for C2 instances Family.
	FamilyC2 = "c2"
	// FamilyM1 Identification for M1 instances Family.
	FamilyM1 = "m1"
	// FamilyM2 Identification for M2 instances Family.
	FamilyM2 = "m2"

	// BillingPreemptible Identification for Preemptible instances.
	BillingPreemptible = "preemptible"
)

Variables

This section is empty.

Functions

func Handler

func Handler(w http.ResponseWriter, r *http.Request)

Handler responds to an HTTP request to get the pricing info for Compute.

func InitSKUPriceList

func InitSKUPriceList(svc *cloudbilling.APIService) error

Types

type Price

type Price struct {
	Currency      string  `json:"currency"`
	ComputePrice  float64 `json:"computePrice"`
	OsPrice       float64 `json:"osPrice"`
	EffectiveTime string  `json:"effectiveTime"`
}

Price type has all the fields in the HTTP response.

type Request

type Request struct {
	Instances int     `json:"instances"`
	Region    string  `json:"region"`
	Family    string  `json:"family"`
	CPU       float64 `json:"cpu"`
	RAM       float64 `json:"ram"`
	Billing   string  `json:"billing"`
	Hours     float64 `json:"hours"`
	Os        string  `json:"os"`
}

Request type has all the fields in the HTTP request.

type SUD

type SUD struct {
	Hours      [4]float64
	Percentage [4]float64
}

SUD has arrays with the hours and percentage for calculating the discounts.

type SkuOS

type SkuOS = map[string]string
var SkuOSList SkuOS

type SkuPrice

type SkuPrice = map[string]*cloudbilling.PricingInfo
var SkuPriceList SkuPrice

type SkuVM

type SkuVM = map[string]map[string]map[string]string
var SkuVMList SkuVM

func InitData

func InitData() SkuVM

Jump to

Keyboard shortcuts

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