Documentation ¶
Index ¶
- Variables
- func ConvertServiceMapToArray(s map[int]Service, granularity string) [][]string
- func ConvertServiceSliceToArray(s []Service, granularity string) [][]string
- func ConvertServiceToSlice(s Service, granularity string) [][]string
- func ConvertToChartInputType(r CostAndUsageOutputType, s []Service) chart.InputType
- func ConvertToFloat(amount string) float64
- func CostAndUsageToCSV(sortFn func(r map[int]Service) []Service, r CostAndUsageOutputType) error
- func CostAndUsageToChart(sortFn func(r map[int]Service) []Service, r CostAndUsageOutputType) error
- func CostAndUsageToOpenAI(sortFn func(r map[int]Service) []Service, r CostAndUsageOutputType) error
- func CostAndUsageToStdout(sortFn func(r map[int]Service) []Service, r CostAndUsageOutputType)
- func CreateSubTitle(granularity string, start string, end string) string
- func CreateTable(header table.Row) table.Writer
- func ForecastToRows(r ForecastPrintData) []table.Row
- func ForecastToStdout(r ForecastPrintData, dimensions []string)
- func MaxRows(rows [][]string, maxRows int) int
- func ResultsToServicesMap(res []types.ResultByTime) map[int]Service
- func ReturnIfPresent(s []string) string
- func SortFunction(sortBy string) func(r map[int]Service) []Service
- type ChartData
- type ChartPrinter
- type CostAndUsage
- type CostAndUsageOutputType
- type CostAndUsageReport
- type CsvPrinter
- type Error
- type ForecastPrintData
- type FormatError
- type Metrics
- type OpenAIPrinter
- type PrintWriterType
- type Printer
- type Service
- type SortBy
- type StdoutPrinter
Constants ¶
This section is empty.
Variables ¶
View Source
var (
OutputDir = "./output"
)
Functions ¶
func ConvertServiceMapToArray ¶ added in v0.3.11
func ConvertServiceSliceToArray ¶ added in v0.3.11
func ConvertServiceToSlice ¶ added in v0.3.0
func ConvertToChartInputType ¶ added in v0.3.11
func ConvertToChartInputType(r CostAndUsageOutputType, s []Service) chart.InputType
func ConvertToFloat ¶
func CostAndUsageToCSV ¶ added in v0.3.0
func CostAndUsageToCSV(sortFn func(r map[int]Service) []Service, r CostAndUsageOutputType) error
func CostAndUsageToChart ¶ added in v0.3.0
func CostAndUsageToChart(sortFn func(r map[int]Service) []Service, r CostAndUsageOutputType) error
func CostAndUsageToOpenAI ¶ added in v0.3.11
func CostAndUsageToOpenAI(sortFn func(r map[int]Service) []Service, r CostAndUsageOutputType) error
func CostAndUsageToStdout ¶ added in v0.3.0
func CostAndUsageToStdout(sortFn func(r map[int]Service) []Service, r CostAndUsageOutputType)
func CreateSubTitle ¶ added in v0.3.0
func ForecastToRows ¶ added in v0.3.0
func ForecastToRows(r ForecastPrintData) []table.Row
func ForecastToStdout ¶ added in v0.3.0
func ForecastToStdout(r ForecastPrintData, dimensions []string)
func ResultsToServicesMap ¶ added in v0.3.0
func ResultsToServicesMap(res []types.ResultByTime) map[int]Service
func ReturnIfPresent ¶
Types ¶
type ChartPrinter ¶ added in v0.3.0
type ChartPrinter struct {
Variant string
}
func (*ChartPrinter) Print ¶ added in v0.3.0
func (p *ChartPrinter) Print(f interface{}, c interface{}) error
type CostAndUsage ¶ added in v0.3.0
func CostUsageToRows ¶ added in v0.3.0
func CostUsageToRows(s []Service, granularity string) CostAndUsage
type CostAndUsageOutputType ¶ added in v0.3.0
type CostAndUsageOutputType struct { Services map[int]Service Granularity string Start string End string Dimensions []string Tags []string SortBy string OpenAIAPIKey string }
func CurateCostAndUsageReport ¶
func CurateCostAndUsageReport( d *costexplorer.GetCostAndUsageOutput, query aws2.CostAndUsageRequestType) CostAndUsageOutputType
func ToCostAndUsageOutputType ¶ added in v0.3.0
func ToCostAndUsageOutputType(r *costexplorer.GetCostAndUsageOutput, u aws2.CostAndUsageRequestType) CostAndUsageOutputType
type CostAndUsageReport ¶
type CostAndUsageReport struct { Services map[int]Service Start string End string Granularity string Dimensions []string Tags []string }
func (CostAndUsageReport) Equals ¶
func (c CostAndUsageReport) Equals(c2 CostAndUsageReport) bool
func (CostAndUsageReport) Len ¶
func (c CostAndUsageReport) Len() int
func (CostAndUsageReport) Less ¶
func (c CostAndUsageReport) Less(i, j int) bool
func (CostAndUsageReport) Swap ¶
func (c CostAndUsageReport) Swap(i, j int)
type CsvPrinter ¶ added in v0.3.0
type CsvPrinter struct {
Variant string
}
func (*CsvPrinter) Print ¶ added in v0.3.0
func (p *CsvPrinter) Print(f interface{}, c interface{}) error
type ForecastPrintData ¶ added in v0.2.0
type ForecastPrintData struct { Forecast *costexplorer.GetCostForecastOutput Filters []string }
type FormatError ¶ added in v0.3.11
type FormatError struct {
Msg string
}
func (FormatError) Error ¶ added in v0.3.11
func (e FormatError) Error() string
type Metrics ¶
type Metrics struct { Name string Amount string NumericAmount float64 Unit string UsageQuantity float64 }
func MetricsToService ¶ added in v0.3.0
func MetricsToService(m map[string]types.MetricValue) []Metrics
type OpenAIPrinter ¶ added in v0.3.11
type OpenAIPrinter struct {
Variant string
}
func (*OpenAIPrinter) Print ¶ added in v0.3.11
func (p *OpenAIPrinter) Print(f interface{}, c interface{}) error
type PrintWriterType ¶ added in v0.3.0
type PrintWriterType int
const ( Stdout PrintWriterType = iota CSV Chart OpenAPI )
func ToPrintWriterType ¶ added in v0.3.0
func ToPrintWriterType(s string) PrintWriterType
type Printer ¶ added in v0.3.0
type Printer interface {
Print(interface{}, interface{}) error
}
func PrintFactory ¶ added in v0.3.0
func PrintFactory(printType PrintWriterType, variant string) Printer
type StdoutPrinter ¶ added in v0.3.0
type StdoutPrinter struct {
Variant string
}
func (*StdoutPrinter) Print ¶ added in v0.3.0
func (p *StdoutPrinter) Print(f interface{}, c interface{}) error
Click to show internal directories.
Click to hide internal directories.