Documentation
¶
Index ¶
- type CostExplorerService
- type CostGroup
- type CostResult
- type ServicePricing
- type Store
- func (s *Store) GenerateCostAndUsage(start, end string, granularity string, groupBy []map[string]string) []CostResult
- func (s *Store) GenerateForecast(start, end string, granularity, metric string) ([]CostResult, string)
- func (s *Store) GetDimensionValues(dimension string) []string
- func (s *Store) GetTags() []string
- func (s *Store) SetServiceCount(count int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CostExplorerService ¶
type CostExplorerService struct {
// contains filtered or unexported fields
}
CostExplorerService is the cloudmock implementation of the AWS Cost Explorer API.
func New ¶
func New(accountID, region string) *CostExplorerService
New returns a new CostExplorerService for the given AWS account ID and region.
func (*CostExplorerService) Actions ¶
func (s *CostExplorerService) Actions() []service.Action
Actions returns the list of Cost Explorer API actions supported by this service.
func (*CostExplorerService) HandleRequest ¶
func (s *CostExplorerService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)
HandleRequest routes an incoming Cost Explorer request to the appropriate handler.
func (*CostExplorerService) HealthCheck ¶
func (s *CostExplorerService) HealthCheck() error
HealthCheck always returns nil.
func (*CostExplorerService) Name ¶
func (s *CostExplorerService) Name() string
Name returns the AWS service name used for routing.
type CostResult ¶
type CostResult struct {
TimePeriod map[string]string
Total map[string]map[string]string
Groups []CostGroup
}
CostResult represents a cost and usage result for a time period.
type ServicePricing ¶
type ServicePricing struct {
Name string
BaseCost float64 // Monthly base cost in USD
Unit string // Pricing unit description
UnitCost float64 // Cost per unit
}
ServicePricing holds realistic AWS pricing info for mock cost generation.
func DefaultServicePricing ¶
func DefaultServicePricing() []ServicePricing
DefaultServicePricing returns realistic AWS service pricing data.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages Cost Explorer mock data.
func (*Store) GenerateCostAndUsage ¶
func (s *Store) GenerateCostAndUsage(start, end string, granularity string, groupBy []map[string]string) []CostResult
GenerateCostAndUsage generates realistic mock cost data for the given time range.
func (*Store) GenerateForecast ¶
func (s *Store) GenerateForecast(start, end string, granularity, metric string) ([]CostResult, string)
GenerateForecast generates a mock cost forecast, extrapolating from current pricing data.
func (*Store) GetDimensionValues ¶
GetDimensionValues returns mock dimension values.
func (*Store) SetServiceCount ¶
SetServiceCount updates the number of active services, which scales cost generation.