light modification
This commit is contained in:
@@ -135,10 +135,10 @@ func (r *PricedComputeResource) GetType() tools.DataType {
|
||||
|
||||
func (r *PricedComputeResource) GetPrice() (float64, error) {
|
||||
if r.UsageStart == nil || r.UsageEnd == nil {
|
||||
return 0, errors.New("Usage start and end must be set")
|
||||
return 0, errors.New("usage start and end must be set")
|
||||
}
|
||||
if r.SelectedPricing == nil {
|
||||
return 0, errors.New("Selected pricing must be set")
|
||||
return 0, errors.New("selected pricing must be set")
|
||||
}
|
||||
pricing := *r.SelectedPricing
|
||||
price := float64(0)
|
||||
|
@@ -95,7 +95,7 @@ func (t DataResourcePricingStrategy) GetQuantity(amountOfDataGB float64) (float6
|
||||
case PER_KB_DOWNLOADED:
|
||||
return amountOfDataGB / 1000000, nil
|
||||
}
|
||||
return 0, errors.New("Pricing strategy not found")
|
||||
return 0, errors.New("pricing strategy not found")
|
||||
}
|
||||
|
||||
type DataResourcePricingProfile struct {
|
||||
@@ -125,10 +125,10 @@ func (r *PricedDataResource) GetType() tools.DataType {
|
||||
|
||||
func (r *PricedDataResource) GetPrice() (float64, error) {
|
||||
if r.UsageStart == nil || r.UsageEnd == nil {
|
||||
return 0, errors.New("Usage start and end must be set")
|
||||
return 0, errors.New("usage start and end must be set")
|
||||
}
|
||||
if r.SelectedPricing == nil {
|
||||
return 0, errors.New("Selected pricing must be set")
|
||||
return 0, errors.New("selected pricing must be set")
|
||||
}
|
||||
pricing := *r.SelectedPricing
|
||||
var err error
|
||||
|
@@ -81,10 +81,10 @@ func (abs *PricedResource) GetExplicitDurationInS() float64 {
|
||||
|
||||
func (r *PricedResource) GetPrice() (float64, error) {
|
||||
if r.UsageStart == nil || r.UsageEnd == nil {
|
||||
return 0, errors.New("Usage start and end must be set")
|
||||
return 0, errors.New("usage start and end must be set")
|
||||
}
|
||||
if r.SelectedPricing == nil {
|
||||
return 0, errors.New("Selected pricing must be set")
|
||||
return 0, errors.New("selected pricing must be set")
|
||||
}
|
||||
return (*r.SelectedPricing).GetPrice(1, 0, *r.UsageStart, *r.UsageEnd)
|
||||
}
|
||||
|
@@ -105,7 +105,7 @@ func (t StorageResourcePricingStrategy) GetQuantity(amountOfDataGB float64) (flo
|
||||
case PER_KB_STORED:
|
||||
return amountOfDataGB * 1000000, nil
|
||||
}
|
||||
return 0, errors.New("Pricing strategy not found")
|
||||
return 0, errors.New("pricing strategy not found")
|
||||
}
|
||||
|
||||
type StorageResourcePricingProfile struct {
|
||||
@@ -131,10 +131,10 @@ func (r *PricedStorageResource) GetType() tools.DataType {
|
||||
|
||||
func (r *PricedStorageResource) GetPrice() (float64, error) {
|
||||
if r.UsageStart == nil || r.UsageEnd == nil {
|
||||
return 0, errors.New("Usage start and end must be set")
|
||||
return 0, errors.New("usage start and end must be set")
|
||||
}
|
||||
if r.SelectedPricing == nil {
|
||||
return 0, errors.New("Selected pricing must be set")
|
||||
return 0, errors.New("selected pricing must be set")
|
||||
}
|
||||
pricing := *r.SelectedPricing
|
||||
var err error
|
||||
|
Reference in New Issue
Block a user