Documentation ¶
Index ¶
- Constants
- func GetConfigProvider(config Config) (client.ConfigProvider, error)
- func Must(c client.ConfigProvider, err error) client.ConfigProvider
- func NewCostCalculatorEC2(api pricingiface.PricingAPI) calculator.CostCalculator
- func ParseEC2(product map[string]interface{}) (calculator.Rate, error)
- type Config
- type PriceParser
Constants ¶
View Source
const ( // KindMachines is used to identify the kind of calculator.Resource for EC2 machines. KindMachines = "AmazonEC2" // KindStorage is used to identify the kind of calculator.Resource for S3 storage. KindStorage = "AmazonS3" )
Variables ¶
This section is empty.
Functions ¶
func GetConfigProvider ¶
func GetConfigProvider(config Config) (client.ConfigProvider, error)
GetConfigProvider returns a new Amazon Web Services session.
func Must ¶
func Must(c client.ConfigProvider, err error) client.ConfigProvider
Must forces GetConfigProvider to return the ConfigProvider. If there is an error when calling GetConfigProvider, Must will panic. Example:
c := Must(GetConfigProvider(Config{}))
func NewCostCalculatorEC2 ¶
func NewCostCalculatorEC2(api pricingiface.PricingAPI) calculator.CostCalculator
NewCostCalculatorEC2 initializes a new cost calculator for AWS EC2 resources.
Types ¶
type Config ¶
type Config struct { // Region represents the region where the AWS client will connect to. // Specifying the wrong region may cause problems when launching simulations. Region string }
Config is used to configure a ConfigProvider.
type PriceParser ¶
type PriceParser func(price map[string]interface{}) (calculator.Rate, error)
PriceParser parses a given AWS price result from the Pricing API and returns a calculator.Rate value. Different implementations depending on the response of the Pricing API can be added using this function signature. EC2 example: ParseEC2
Click to show internal directories.
Click to hide internal directories.