Documentation
¶
Overview ¶
Package cost provides simulated cost tracking for cloud operations.
Index ¶
- type ServiceCost
- type Tracker
- func (t *Tracker) AllCosts() []ServiceCost
- func (t *Tracker) CostByOperation() map[string]float64
- func (t *Tracker) CostByService() map[string]float64
- func (t *Tracker) Record(service, operation string, quantity int)
- func (t *Tracker) Reset()
- func (t *Tracker) SetRate(service, operation string, rate float64)
- func (t *Tracker) TotalCost() float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceCost ¶
type ServiceCost struct {
Service string
Operation string
UnitCost float64
Quantity int
Total float64
}
ServiceCost defines the cost structure for a single service operation.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker tracks simulated costs across all cloud operations.
func (*Tracker) AllCosts ¶
func (t *Tracker) AllCosts() []ServiceCost
AllCosts returns a copy of all recorded cost events.
func (*Tracker) CostByOperation ¶
CostByOperation returns the total cost grouped by service:operation.
func (*Tracker) CostByService ¶
CostByService returns the total cost grouped by service.
Click to show internal directories.
Click to hide internal directories.