package economics import "time" // Bill sources. const ( SourceManual = "manual" SourceCostExplorer = "costexplorer" ) // Bill is economics/bills/.json — the real AWS bill for one month, // whole-account by-service (attribution to CARLOS is a dashboard knob, not // a pull-time filter — both AWS accounts hold non-CARLOS resources). type Bill struct { Schema int `json:"schema"` // 1 Month string `json:"month"` // "2006-01" TotalUSD float64 `json:"total_usd"` Services map[string]float64 `json:"services"` Source string `json:"source"` // SourceManual | SourceCostExplorer // PulledAt uses omitzero, not omitempty: encoding/json's omitempty never // treats a zero time.Time as empty (it isn't a nil/0/"" by the encoder's // own rule), so a manually-entered bill — which never sets this field — // would otherwise marshal a lying "0001-01-01T00:00:00Z" pulled_at key. PulledAt time.Time `json:"pulled_at,omitzero"` } // BillsPrefix lists stored bills. const BillsPrefix = "economics/bills/" // BillKey is the bucket key for a month's bill. func BillKey(month string) string { return BillsPrefix + month + ".json" }