src/bosh-softlayer-cpi/softlayer/client/client.go
func FindPerformanceSpacePrice(productPackage datatypes.Product_Package, size int) (datatypes.Product_Item_Price, error) {
	for _, item := range productPackage.Items {
		if int(*item.Capacity) != size {
			continue
		}
		for _, price := range item.Prices {
			// Only collect prices from valid location groups.
			if price.LocationGroupId != nil {
				continue
			}
			if !hasCategory(price.Categories, "performance_storage_space") {
				continue
			}
			return price, nil
		}
	}
	return datatypes.Product_Item_Price{}, bosherr.Errorf("Unable to find disk space price with size of %d for the given volume", size)
}
func FindPerformanceSpacePrice(productPackage datatypes.Product_Package, size int) (datatypes.Product_Item_Price, error) {
	for _, item := range productPackage.Items {
		if int(*item.Capacity) != size {
			continue
		}
		for _, price := range item.Prices {
			// Only collect prices from valid location groups.
			if price.LocationGroupId != nil {
				continue
			}
			if !hasCategory(price.Categories, "performance_storage_space") {
				continue
			}
			return price, nil
		}
	}
	return datatypes.Product_Item_Price{}, bosherr.Errorf("Unable to find disk space price with size of %d for the given volume", size)
}
func FindPerformanceSpacePrice ( productPackage datatypes . Product_Package , size int ) ( datatypes . Product_Item_Price , error ) { for _ , item := range productPackage . Items { if int ( * item . Capacity ) != size { continue } for _ , price := range item . Prices { // Only collect prices from valid location groups. if price . LocationGroupId != nil { continue } if ! hasCategory ( price . Categories , " " ) { continue } return price , nil } } return datatypes . Product_Item_Price { } , bosherr . Errorf ( " " , size ) }
// Find the price in the given package with the specified size
Find the price in the given package with the specified size