js

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: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	Before string `json:"before"`
	After  string `json:"after"`
}

Change contains before and after value of the certain field.

type ComputeDiskStateOut

type ComputeDiskStateOut struct {
	Name     Change           `json:"name"`
	ID       Change           `json:"id"`
	Zones    Change           `json:"zones"`
	DiskType Change           `json:"disk_type"`
	Action   string           `json:"action"`
	Pricing  DiskStatePricing `json:"pricing_info"`
}

ComputeDiskStateOut contains ComputeDiskState information to be outputted.

func (*ComputeDiskStateOut) AddToJSONTableList

func (out *ComputeDiskStateOut) AddToJSONTableList(json *JsonOutput)

type ComputeInstanceStateOut

type ComputeInstanceStateOut struct {
	Name        Change               `json:"name"`
	InstanceID  Change               `json:"instance_id"`
	Zone        Change               `json:"zone"`
	MachineType Change               `json:"machine_type"`
	CpuType     Change               `json:"cpu_type"`
	RamType     Change               `json:"ram_type"`
	Action      string               `json:"action"`
	Pricing     InstanceStatePricing `json:"pricing_info"`
}

ComputeInstanceStateOut contains ComputeInstanceState information to be outputted.

func (*ComputeInstanceStateOut) AddToJSONTableList

func (out *ComputeInstanceStateOut) AddToJSONTableList(json *JsonOutput)

type DiskPricing

type DiskPricing struct {
	Disk Pricing `json:"disk"`
}

DiskPricing contains ComputeDisk pricing info to be outputted.

type DiskStatePricing

type DiskStatePricing struct {
	Before *DiskPricing `json:"before"`
	After  *DiskPricing `json:"after"`
	Delta  float64      `json:"cost_change"`
}

DiskStatePricing contains ComputeDiskState pricing info to be outputted.

type InstancePricing

type InstancePricing struct {
	Cpu       Pricing `json:"cpu"`
	Ram       Pricing `json:"ram"`
	TotalCost float64 `json:"total_cost"`
}

InstancePricing contains ComputeInstance pricing info to be outputted.

type InstanceStatePricing

type InstanceStatePricing struct {
	Before   *InstancePricing `json:"before"`
	After    *InstancePricing `json:"after"`
	DeltaCpu float64          `json:"cpu_cost_change"`
	DeltaRam float64          `json:"ram_cost_change"`
	Delta    float64          `json:"cost_change"`
}

InstanceStatePricing contains ComputeInstanceState pricing info to be outputted.

type JSONOut

type JSONOut interface {
	AddToJSONTableList(*JsonOutput)
}

JSONOut is a general interface of a JSON output.

type JsonOutput

type JsonOutput struct {
	Delta                   float64                    `json:"cost_change"`
	PricingUnit             string                     `json:"pricing_unit"`
	ComputeInstancesPricing []*ComputeInstanceStateOut `json:"instances_pricing_info"`
	ComputeDisksPricing     []*ComputeDiskStateOut     `json:"disks_pricing_info"`
}

JsonOutput contains relevant information resources and cost changes in a file.

type Pricing

type Pricing struct {
	//if the cost of unit is unknown we use string "-"
	UnitCost  string `json:"cost_per_unit"`
	NumUnits  string `json:"number_of_units"`
	TotalCost string `json:"cost_of_units"`
}

Pricing contains the pricing details about a certain component.

Jump to

Keyboard shortcuts

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