Documentation ¶
Index ¶
- Variables
- func GetPrices(r *schema.Resource, q QueryRunner) error
- func GetPricesConcurrent(resources []*schema.Resource, q QueryRunner) error
- func PopulatePrices(cfg *config.Config, project *schema.Project) error
- type GraphQLQuery
- type GraphQLQueryRunner
- type PricingAPIError
- type QueryResult
- type QueryRunner
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidAPIKey = errors.New("Invalid API key")
Functions ¶
func GetPricesConcurrent ¶ added in v0.7.15
func GetPricesConcurrent(resources []*schema.Resource, q QueryRunner) error
GetPricesConcurrent gets the prices of all resources concurrently. Concurrency level is calculated using the following formula: max(min(4, numCPU * 4), 16)
Types ¶
type GraphQLQuery ¶
type GraphQLQueryRunner ¶
type GraphQLQueryRunner struct {
// contains filtered or unexported fields
}
func NewGraphQLQueryRunner ¶
func NewGraphQLQueryRunner(endpoint string, apiKey string) *GraphQLQueryRunner
func (*GraphQLQueryRunner) RunQueries ¶
func (q *GraphQLQueryRunner) RunQueries(r *schema.Resource) ([]QueryResult, error)
type PricingAPIError ¶
type PricingAPIError struct {
// contains filtered or unexported fields
}
func (*PricingAPIError) Error ¶
func (e *PricingAPIError) Error() string
type QueryResult ¶
type QueryRunner ¶
type QueryRunner interface {
RunQueries(resource *schema.Resource) ([]QueryResult, error)
}
Click to show internal directories.
Click to hide internal directories.