Documentation
¶
Overview ¶
Package storagecost provides DynamORM-based storage implementation for cost tracking and analytics.
Index ¶
- type DynamORMStorage
- func (s *DynamORMStorage) GetCostByOperation(ctx context.Context, startDate, endDate time.Time) (map[string]int64, error)
- func (s *DynamORMStorage) GetCostByService(ctx context.Context, startDate, endDate time.Time) (map[string]int64, error)
- func (s *DynamORMStorage) GetCurrentMonthProjection(ctx context.Context) (*cost.MonthlyCostAggregate, error)
- func (s *DynamORMStorage) GetDailyCosts(ctx context.Context, startDate, endDate time.Time) ([]cost.DailyCostAggregate, error)
- func (s *DynamORMStorage) GetMonthlyCost(ctx context.Context, year int, month time.Month) (*cost.MonthlyCostAggregate, error)
- func (s *DynamORMStorage) GetMonthlyCosts(ctx context.Context, months int) ([]cost.MonthlyCostAggregate, error)
- func (s *DynamORMStorage) SaveOperationCost(ctx context.Context, opCost *cost.OperationCost) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamORMStorage ¶
type DynamORMStorage struct {
// contains filtered or unexported fields
}
DynamORMStorage handles persistence of cost data using DynamORM
func NewDynamORMStorage ¶
NewDynamORMStorage creates a new DynamORM-based cost storage instance
func (*DynamORMStorage) GetCostByOperation ¶
func (s *DynamORMStorage) GetCostByOperation(ctx context.Context, startDate, endDate time.Time) (map[string]int64, error)
GetCostByOperation retrieves costs grouped by operation type
func (*DynamORMStorage) GetCostByService ¶
func (s *DynamORMStorage) GetCostByService(ctx context.Context, startDate, endDate time.Time) (map[string]int64, error)
GetCostByService retrieves costs grouped by service/function
func (*DynamORMStorage) GetCurrentMonthProjection ¶
func (s *DynamORMStorage) GetCurrentMonthProjection(ctx context.Context) (*cost.MonthlyCostAggregate, error)
GetCurrentMonthProjection projects costs for the current month
func (*DynamORMStorage) GetDailyCosts ¶
func (s *DynamORMStorage) GetDailyCosts(ctx context.Context, startDate, endDate time.Time) ([]cost.DailyCostAggregate, error)
GetDailyCosts retrieves daily cost aggregates for a date range
func (*DynamORMStorage) GetMonthlyCost ¶
func (s *DynamORMStorage) GetMonthlyCost(ctx context.Context, year int, month time.Month) (*cost.MonthlyCostAggregate, error)
GetMonthlyCost retrieves cost data for a specific month
func (*DynamORMStorage) GetMonthlyCosts ¶
func (s *DynamORMStorage) GetMonthlyCosts(ctx context.Context, months int) ([]cost.MonthlyCostAggregate, error)
GetMonthlyCosts retrieves monthly cost aggregates
func (*DynamORMStorage) SaveOperationCost ¶
func (s *DynamORMStorage) SaveOperationCost(ctx context.Context, opCost *cost.OperationCost) error
SaveOperationCost saves a single operation cost to DynamoDB using DynamORM