pricing

package
v0.0.0-...-f473c80 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright © 2023 Nils Knieling <https://github.com/Cyclenerd>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2023 Nils Knieling <https://github.com/Cyclenerd>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2023 Nils Knieling <https://github.com/Cyclenerd>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2023 Nils Knieling <https://github.com/Cyclenerd>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2023 Nils Knieling <https://github.com/Cyclenerd>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2023 Nils Knieling <https://github.com/Cyclenerd>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2023 Nils Knieling <https://github.com/Cyclenerd>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var CostSum float32
View Source
var File string
View Source
var LineItems []LineItem
View Source
var Project string

Functions

func CalcComputeDisk

func CalcComputeDisk(pricingYml StructPricing, inputName string, inputStorageType string, inputStorageData float32, inputRegion string, inputDiscount float32) float32

func CalcComputeInstance

func CalcComputeInstance(pricingYml StructPricing, inputName string, inputMachineType string, inputRegion string, inputDiscount float32, inputCommitment int, inputSpot bool, inputTerminated bool) float32

func CalcComputeLicense

func CalcComputeLicense(pricingYml StructPricing, inputName string, inputMachineType string, inputOperatingSystem string, inputDiscount float32, inputCommitment int, inputTerminated bool) float32

func CalcComputeNetworkIp

func CalcComputeNetworkIp(pricingYml StructPricing, inputName string, inputExternalIp int, inputRegion string, inputDiscount float32, inputTerminated bool) float32

func CalcComputeNetworkNatGateway

func CalcComputeNetworkNatGateway(pricingYml StructPricing, inputName string, inputData float32, inputRegion string, inputDiscount float32) float32

func CalcComputeNetworkTrafficEgress

func CalcComputeNetworkTrafficEgress(pricingYml StructPricing, inputName string, inputWorld float32, inputChina float32, inputAustralia float32, inputRegion string, inputDiscount float32) float32

func CalcComputeNetworkVpnTunnel

func CalcComputeNetworkVpnTunnel(pricingYml StructPricing, inputName string, inputRegion string, inputDiscount float32) float32

func CalcMonitoring

func CalcMonitoring(pricingYml StructPricing, inputName string, inputData float32, inputRegion string, inputDiscount float32) float32

func CalcStorageBucket

func CalcStorageBucket(pricingYml StructPricing, inputName string, inputStorageClass string, inputStorageData float32, inputStorageRetrieval float32, inputRegion string, inputDiscount float32) float32

func CheckRegion

func CheckRegion(pricingYml StructPricing, inputRegion string) bool

func ExportCsv

func ExportCsv(lineItems []LineItem, inputExportCsv string)

func Hour

func Hour(cost Cost) float32

func HourSpot

func HourSpot(cost Cost) float32

func Month

func Month(cost Cost) float32

func Month1Y

func Month1Y(cost Cost) float32

func Month3Y

func Month3Y(cost Cost) float32

func MonthSpot

func MonthSpot(cost Cost) float32

func OverwirteDefault

func OverwirteDefault(pricingYml StructPricing, defaultRegion string, inputRegion string, defaultDiscount float32, inputDiscount float32) (string, float32)

func ReturnDiscount

func ReturnDiscount(defaultDiscount float32, inputDiscount float32) float32

func ReturnProject

func ReturnProject(defaultProject string, inputProject string) string

func ReturnRegion

func ReturnRegion(pricingYml StructPricing, defaultRegion string, inputRegion string) string

Types

type Bucket

type Bucket struct {
	Cost map[string]Cost
}

func CheckStorageBucket

func CheckStorageBucket(pricingYml StructPricing, inputStorageClass string) Bucket

type Cost

type Cost struct {
	Hour      float32
	HourSpot  float32 `yaml:"hour_spot"`
	Month     float32
	Month1Y   float32 `yaml:"month_1y"`
	Month3Y   float32 `yaml:"month_3y"`
	MonthSpot float32 `yaml:"month_spot"`
}

func CostComputeDisk

func CostComputeDisk(pricingYml StructPricing, inputDiskType string, inputRegion string) Cost

func CostComputeInstance

func CostComputeInstance(pricingYml StructPricing, inputMachineType string, inputRegion string) Cost

func CostComputeLicense

func CostComputeLicense(pricingYml StructPricing, inputMachineType string, inputOperatingSystem string) Cost

func CostComputeNetworkIpUnused

func CostComputeNetworkIpUnused(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkIpVm

func CostComputeNetworkIpVm(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkNatData

func CostComputeNetworkNatData(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkNatGateway

func CostComputeNetworkNatGateway(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkTrafficEgressAustraliaTiB0_1

func CostComputeNetworkTrafficEgressAustraliaTiB0_1(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkTrafficEgressAustraliaTiB10n

func CostComputeNetworkTrafficEgressAustraliaTiB10n(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkTrafficEgressAustraliaTiB1_10

func CostComputeNetworkTrafficEgressAustraliaTiB1_10(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkTrafficEgressChinaTiB0_1

func CostComputeNetworkTrafficEgressChinaTiB0_1(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkTrafficEgressChinaTiB10n

func CostComputeNetworkTrafficEgressChinaTiB10n(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkTrafficEgressChinaTiB1_10

func CostComputeNetworkTrafficEgressChinaTiB1_10(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkTrafficEgressTiB0_1

func CostComputeNetworkTrafficEgressTiB0_1(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkTrafficEgressTiB10n

func CostComputeNetworkTrafficEgressTiB10n(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkTrafficEgressTiB1_10

func CostComputeNetworkTrafficEgressTiB1_10(pricingYml StructPricing, inputRegion string) Cost

func CostComputeNetworkVpnTunnel

func CostComputeNetworkVpnTunnel(pricingYml StructPricing, inputRegion string) Cost

func CostMonitoringDataMiB0_100000

func CostMonitoringDataMiB0_100000(pricingYml StructPricing, inputRegion string) Cost

func CostMonitoringDataMiB0_100000_250000

func CostMonitoringDataMiB0_100000_250000(pricingYml StructPricing, inputRegion string) Cost

func CostMonitoringDataMiB0_250000n

func CostMonitoringDataMiB0_250000n(pricingYml StructPricing, inputRegion string) Cost

func CostStorageBucket

func CostStorageBucket(pricingYml StructPricing, inputStorageClass string, inputRegion string) Cost

func CostStorageRetrieval

func CostStorageRetrieval(pricingYml StructPricing, inputStorageClass string, inputRegion string) Cost

type DualRegion

type DualRegion struct {
	Regions []string
}

type Instance

type Instance struct {
	Cpu  float32
	Ram  float32
	Cost map[string]Cost
}

func CheckComputeInstance

func CheckComputeInstance(pricingYml StructPricing, inputMachineType string) Instance

type License

type License struct {
	Cost map[string]Cost
}

func CheckComputeLicense

func CheckComputeLicense(pricingYml StructPricing, inputMachineType string) License

type LineItem

type LineItem struct {
	Project    string
	Region     string
	Resource   string
	Name       string
	Cost       float32
	Type       string // Type or Class
	Data       float32
	Commitment int
	Discount   float32
	File       string
}

type MultiRegion

type MultiRegion struct {
	Description string
}

type Region

type Region struct {
	Location string
}

type Retrieval

type Retrieval struct {
	Cost map[string]Cost
}

func CheckStorageRetrieval

func CheckStorageRetrieval(pricingYml StructPricing, inputStorageClass string) Retrieval

type Storage

type Storage struct {
	Type string
	Cost map[string]Cost
}

func CheckComputeDisk

func CheckComputeDisk(pricingYml StructPricing, inputDiskType string) Storage

type StructPricing

type StructPricing struct {
	About struct {
		Copyright string
		Generated string
		Timestamp string
		Url       string
	}
	Region      map[string]Region
	DualRegion  map[string]DualRegion  `yaml:"dual-region"`
	MultiRegion map[string]MultiRegion `yaml:"multi-region"`
	Monitoring  struct {
		Data struct {
			Cost struct {
				MiB0_100000        map[string]Cost `yaml:"0-100000"`
				MiB0_100000_250000 map[string]Cost `yaml:"100000-250000"`
				MiB0_250000n       map[string]Cost `yaml:"250000n"`
			}
		}
	}
	Storage struct {
		Bucket    map[string]Bucket
		Retrieval map[string]Retrieval
	}
	Compute struct {
		Storage  map[string]Storage
		Instance map[string]Instance
		License  map[string]License
		Network  struct {
			Ip struct {
				Unused struct {
					Cost map[string]Cost
				}
				Vm struct {
					Cost map[string]Cost
				}
			}
			Vpn struct {
				Tunnel struct {
					Cost map[string]Cost
				}
			}
			Nat struct {
				Gateway struct {
					Cost map[string]Cost
				}
				Data struct {
					Cost map[string]Cost
				}
			}
			Traffic struct {
				Egress struct {
					Internet struct {
						China struct {
							Cost struct {
								TiB0_1  map[string]Cost `yaml:"0-1"`
								TiB1_10 map[string]Cost `yaml:"1-10"`
								TiB10n  map[string]Cost `yaml:"10n"`
							}
						}
						Australia struct {
							Cost struct {
								TiB0_1  map[string]Cost `yaml:"0-1"`
								TiB1_10 map[string]Cost `yaml:"1-10"`
								TiB10n  map[string]Cost `yaml:"10n"`
							}
						}
						Cost struct {
							TiB0_1  map[string]Cost `yaml:"0-1"`
							TiB1_10 map[string]Cost `yaml:"1-10"`
							TiB10n  map[string]Cost `yaml:"10n"`
						}
					}
				}
			}
		}
	}
}

func Yml

func Yml(file string) StructPricing

Jump to

Keyboard shortcuts

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