Documentation
¶
Index ¶
- Variables
- type CSVRecordFormat
- type CSVRecords
- type ClusterRatesReport
- type ClusterReport
- type DomainReport
- type LimesReportRenderer
- func LimesDomainsToReportRenderer(in []limesresources.DomainReport) []LimesReportRenderer
- func LimesProjectRatesToReportRenderer(in []limesrates.ProjectReport, domainID, domainName string, hasRatesOnly bool) []LimesReportRenderer
- func LimesProjectResourcesToReportRenderer(in []limesresources.ProjectReport, domainID, domainName string, ...) []LimesReportRenderer
- type OutputFormat
- type OutputOpts
- type ProjectRatesReport
- type ProjectResourcesReport
Constants ¶
This section is empty.
Variables ¶
var LimesUnits = []limes.Unit{ limes.UnitBytes, limes.UnitKibibytes, limes.UnitMebibytes, limes.UnitGibibytes, limes.UnitTebibytes, limes.UnitPebibytes, limes.UnitExbibytes, }
LimesUnits is a slice of units that Limes understands. Note: the units in this slice **must** be in ascending order.
Functions ¶
This section is empty.
Types ¶
type CSVRecordFormat ¶
type CSVRecordFormat int
CSVRecordFormat type defines the style of CSV records.
const ( CSVRecordFormatDefault CSVRecordFormat = iota CSVRecordFormatLong CSVRecordFormatNames )
Different types of CSVRecordFormat.
type CSVRecords ¶
type CSVRecords [][]string
CSVRecords is exactly that.
func RenderReports ¶
func RenderReports(opts *OutputOpts, rL ...LimesReportRenderer) CSVRecords
RenderReports renders multiple reports and returns the aggregate CSVRecords.
Note: if multiple LimesReportRenderer are given then they must have the same underlying type.
func (CSVRecords) Write ¶
func (d CSVRecords) Write(w io.Writer) error
Write writes CSVRecords to w.
Note: the method takes an io.Writer because it is used in unit tests.
func (CSVRecords) WriteAsTable ¶
func (d CSVRecords) WriteAsTable()
WriteAsTable writes CSVRecords to os.Stdout in table format.
type ClusterRatesReport ¶ added in v3.2.0
type ClusterRatesReport struct {
*limesrates.ClusterReport
}
ClusterRatesReport is a wrapper for limesrates.ClusterReport.
type ClusterReport ¶
type ClusterReport struct {
*limesresources.ClusterReport
}
ClusterReport is a wrapper for limesresources.ClusterReport.
type DomainReport ¶
type DomainReport struct {
*limesresources.DomainReport
}
DomainReport is a wrapper for limesresources.DomainReport.
type LimesReportRenderer ¶
type LimesReportRenderer interface {
// contains filtered or unexported methods
}
LimesReportRenderer is implemented by data types that can render a Limes API report into CSVRecords.
func LimesDomainsToReportRenderer ¶
func LimesDomainsToReportRenderer(in []limesresources.DomainReport) []LimesReportRenderer
LimesDomainsToReportRenderer wraps the given limesresources.DomainReport in a DomainReport and returns a []LimesReportRenderer.
func LimesProjectRatesToReportRenderer ¶ added in v3.0.3
func LimesProjectRatesToReportRenderer( in []limesrates.ProjectReport, domainID, domainName string, hasRatesOnly bool, ) []LimesReportRenderer
LimesProjectRatesToReportRenderer wraps the given limesrates.ProjectReport in a ProjectRatesReport and returns a []LimesReportRenderer.
func LimesProjectResourcesToReportRenderer ¶ added in v3.0.3
func LimesProjectResourcesToReportRenderer( in []limesresources.ProjectReport, domainID, domainName string, hasRatesOnly bool, ) []LimesReportRenderer
LimesProjectResourcesToReportRenderer wraps the given limesresources.ProjectReport in a ProjectResourcesReport and returns a []LimesReportRenderer.
type OutputFormat ¶
type OutputFormat string
OutputFormat that the app can print data in.
const ( OutputFormatTable OutputFormat = "table" OutputFormatCSV OutputFormat = "csv" OutputFormatJSON OutputFormat = "json" )
Different types of OutputFormat.
func (*OutputFormat) Set ¶ added in v3.1.0
func (f *OutputFormat) Set(v string) error
Set implements the pflag.Value interface.
func (*OutputFormat) String ¶ added in v3.1.0
func (f *OutputFormat) String() string
String implements the pflag.Value interface.
func (*OutputFormat) Type ¶ added in v3.1.0
func (f *OutputFormat) Type() string
Type implements the pflag.Value interface.
type OutputOpts ¶
type OutputOpts struct { Fmt OutputFormat CSVRecFmt CSVRecordFormat Humanize bool }
type ProjectRatesReport ¶ added in v3.0.3
type ProjectRatesReport struct { *limesrates.ProjectReport DomainID string DomainName string }
ProjectRatesReport is a wrapper for limesrates.ProjectReport.
type ProjectResourcesReport ¶ added in v3.0.3
type ProjectResourcesReport struct { *limesresources.ProjectReport DomainID string DomainName string }
ProjectResourcesReport is a wrapper for limesresources.ProjectReport.