display

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterCol          = "Cluster"
	NamespaceCol        = "Namespace"
	CPUCol              = "CPU"
	CPUEfficiencyCol    = "CPU Eff."
	MemoryCol           = "Memory"
	MemoryEfficiencyCol = "Memory Eff."
	GPUCol              = "GPU"
	PVCol               = "PV"
	NetworkCol          = "Network"
	SharedCol           = "Shared Cost"
	LoadBalancerCol     = "Load Balancer Cost"
	NameCol             = "Name"
	AssetTypeCol        = "Asset Type"
	CPUCostCol          = "CPU Cost"
	RAMCostCol          = "RAM Cost"
)
View Source
const (
	ColObject         = "object"
	ColResourceUnit   = "resource unit"
	ColMoDiffResource = "Δ qty"
	ColMoDiffCost     = "Δ cost/mo"
	ColMoResource     = "qty"
	ColMoCost         = "cost/mo"
	ColCostPerUnit    = "cost per unit"
	ColPctChange      = "% change"
)

Variables

This section is empty.

Functions

func AddAllocationDisplayOptionsFlags

func AddAllocationDisplayOptionsFlags(cmd *cobra.Command, options *AllocationDisplayOptions)

func AddAssetDisplayOptionsFlags

func AddAssetDisplayOptionsFlags(cmd *cobra.Command, options *AssetDisplayOptions)

func AddPredictDisplayOptionsFlags

func AddPredictDisplayOptionsFlags(cmd *cobra.Command, options *PredictDisplayOptions)

func MakeAllocationTable

func MakeAllocationTable(aggregation []string, allocations map[string]opencost.Allocation, opts AllocationDisplayOptions, currencyCode string, projectToMonthlyRate bool) table.Writer

func MakeAssetTable

func MakeAssetTable(assetType string, assets map[string]query.AssetNode, opts AssetDisplayOptions, currencyCode string, projectToMonthlyRate bool) table.Writer

func MakePredictionTable

func MakePredictionTable(specDiffs []query.SpecCostDiff, currencyCode string, opts PredictDisplayOptions) table.Writer

func WriteAllocationTable

func WriteAllocationTable(out io.Writer, aggregation []string, allocations map[string]opencost.Allocation, opts AllocationDisplayOptions, currencyCode string, projectToMonthlyRate bool)

func WriteAssetTable

func WriteAssetTable(out io.Writer, assetType string, assets map[string]query.AssetNode, opts AssetDisplayOptions, currencyCode string, projectToMonthlyRate bool)

func WritePredictionTable

func WritePredictionTable(out io.Writer, rowData []query.SpecCostDiff, currencyCode string, opts PredictDisplayOptions)

Types

type AllocationDisplayOptions

type AllocationDisplayOptions struct {
	ShowCPUCost          bool
	ShowMemoryCost       bool
	ShowGPUCost          bool
	ShowPVCost           bool
	ShowNetworkCost      bool
	ShowEfficiency       bool
	ShowSharedCost       bool
	ShowLoadBalancerCost bool

	ShowAll bool
}

func (*AllocationDisplayOptions) Complete

func (do *AllocationDisplayOptions) Complete()

type AssetDisplayOptions

type AssetDisplayOptions struct {
	ShowCPUCost    bool
	ShowMemoryCost bool
	ShowAssetType  bool

	ShowAll bool
}

func (*AssetDisplayOptions) Complete

func (do *AssetDisplayOptions) Complete()

type PredictDisplayOptions

type PredictDisplayOptions struct {
	// ShowTotal determines if "After" cost info will be shown alongside the
	// diff
	ShowTotal bool

	// HideDiff will disable diff information if true
	HideDiff bool
}

func (*PredictDisplayOptions) Validate

func (o *PredictDisplayOptions) Validate() error

Jump to

Keyboard shortcuts

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