ce

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

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 CostGroup

type CostGroup struct {
	Keys    []string
	Metrics map[string]map[string]string
}

CostGroup represents a grouped cost result.

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 NewStore

func NewStore(accountID, region string) *Store

NewStore returns a new Cost Explorer Store.

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

func (s *Store) GetDimensionValues(dimension string) []string

GetDimensionValues returns mock dimension values.

func (*Store) GetTags

func (s *Store) GetTags() []string

GetTags returns mock tag keys and values.

func (*Store) SetServiceCount

func (s *Store) SetServiceCount(count int)

SetServiceCount updates the number of active services, which scales cost generation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL