calculator

package
v0.13.22 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calculator

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

Calculator struct for calculating the cost of resources

func NewCalculator

func NewCalculator(substrateConn subi.SubstrateExt, identity substrate.Identity) Calculator

NewCalculator creates a new Calculator

func (*Calculator) CalculateCost

func (c *Calculator) CalculateCost(cru, mru, hru, sru int64, publicIP, certified bool) (float64, error)

CalculateCost calculates the cost in $ per month of the given resources without a discount

func (*Calculator) CalculateDiscount

func (c *Calculator) CalculateDiscount(cost float64) (dedicatedPrice, sharedPrice float64, err error)

CalculateDiscount calculates the discount of a given cost

Jump to

Keyboard shortcuts

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