storagecost

package
v1.1.17 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package storagecost provides DynamORM-based storage implementation for cost tracking and analytics.

Index

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

func NewDynamORMStorage(db core.DB, tableName string, logger *zap.Logger) *DynamORMStorage

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

Jump to

Keyboard shortcuts

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