Bläddra i källkod

Merge pull request #1678 from opencost/niko/cloud-cost-json

Add JSON tags to CloudCostItem types
Niko Kovacevic 3 år sedan
förälder
incheckning
472871de68
1 ändrade filer med 8 tillägg och 8 borttagningar
  1. 8 8
      pkg/kubecost/cloudcostitem.go

+ 8 - 8
pkg/kubecost/cloudcostitem.go

@@ -73,11 +73,11 @@ func (ccip CloudCostItemProperties) Key() string {
 // CloudCostItem represents a CUR line item, identifying a cloud resource and
 // CloudCostItem represents a CUR line item, identifying a cloud resource and
 // its cost over some period of time.
 // its cost over some period of time.
 type CloudCostItem struct {
 type CloudCostItem struct {
-	Properties   CloudCostItemProperties
-	IsKubernetes bool
-	Window       Window
-	Cost         float64
-	NetCost      float64
+	Properties   CloudCostItemProperties `json:"properties"`
+	IsKubernetes bool                    `json:"isKubernetes"`
+	Window       Window                  `json:"window"`
+	Cost         float64                 `json:"cost"`
+	NetCost      float64                 `json:"netCost"`
 }
 }
 
 
 // NewCloudCostItem instantiates a new CloudCostItem asset
 // NewCloudCostItem instantiates a new CloudCostItem asset
@@ -129,9 +129,9 @@ func (cci *CloudCostItem) add(that *CloudCostItem) {
 }
 }
 
 
 type CloudCostItemSet struct {
 type CloudCostItemSet struct {
-	CloudCostItems map[string]*CloudCostItem
-	Window         Window
-	Integration    string
+	CloudCostItems map[string]*CloudCostItem `json:"items"`
+	Window         Window                    `json:"window"`
+	Integration    string                    `json:"-"`
 }
 }
 
 
 // NewAssetSet instantiates a new AssetSet and, optionally, inserts
 // NewAssetSet instantiates a new AssetSet and, optionally, inserts