Documentation
¶
Overview ¶
Package output renders reports as table / JSON.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderDiff ¶
func RenderDiff(w io.Writer, d DiffReport, format string) error
RenderDiff writes the diff report as table / json / markdown (PR-comment friendly).
func ResourceCostTotal ¶
func ResourceCostTotal(rc ResourceCost) float64
ResourceCostTotal sums the MonthlyCost of all components in a single resource.
Types ¶
type CostComponent ¶
type DiffKind ¶
type DiffKind string
DiffKind is + (added), - (removed), ~ (changed), = (unchanged).
type DiffReport ¶
type DiffReport struct {
Resources []ResourceDiff `json:"resources"`
Skipped []SkippedResource `json:"skipped"`
BeforeTotal float64 `json:"before_total"`
AfterTotal float64 `json:"after_total"`
DeltaTotal float64 `json:"delta_total"`
Currency string `json:"currency"`
}
func ComputeDiff ¶
func ComputeDiff(before, after Report) DiffReport
ComputeDiff pairs resources by address and computes monthly delta.
type Report ¶
type Report struct {
Resources []ResourceCost `json:"resources"`
Skipped []SkippedResource `json:"skipped"`
}
type ResourceCost ¶
type ResourceCost struct {
Address string `json:"address"`
Type string `json:"type"`
Components []CostComponent `json:"components"`
}
type ResourceDiff ¶
type SkippedResource ¶
Click to show internal directories.
Click to hide internal directories.