util

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOutputFilePath

func BuildOutputFilePath(dir string, fileName string) string

func ConvertServiceMapToArray added in v0.5.0

func ConvertServiceMapToArray(s map[int]model.Service,
	granularity string) [][]string

func ConvertServiceToSlice added in v0.5.0

func ConvertServiceToSlice(s model.Service, granularity string) [][]string

func ConvertToChartInputType added in v0.5.0

func ConvertToChartInputType(r model.CostAndUsageOutputType,
	s []model.Service) model.InputType

func ConvertToFloat

func ConvertToFloat(amount string) float64

func ConvertToForecastStdoutType added in v0.5.0

func ConvertToForecastStdoutType(r model.ForecastPrintData,
	filteredBy string) model.ForecastStdoutType

func ConvertToPineconeStruct added in v0.5.0

func ConvertToPineconeStruct(items []*model.VectorStoreItem) []pinecone.
	PineconeStruct

func ConvertToStdoutType added in v0.5.0

func ConvertToStdoutType(s []model.Service,
	granularity string) model.CostAndUsageStdoutType

func DayOfCurrentMonth

func DayOfCurrentMonth(time time.Time) int

func DefaultEndDate

func DefaultEndDate(f func(date time.Time) string) string

func DefaultStartDate

func DefaultStartDate(dayOfCurrentMonth func(time time.Time) int,
	subtractDays func(time time.Time, days int) string) string

func EncodeString added in v0.5.0

func EncodeString(s string) string

func Format

func Format(date time.Time) string

func LastDayOfMonth

func LastDayOfMonth() string

func MaxSupportedRows added in v0.5.0

func MaxSupportedRows(rows [][]string, maxRows int) int

func MetricsToService added in v0.5.0

func MetricsToService(m map[string]types.MetricValue) []model.Metrics

func NewFile

func NewFile(dir string, file string) (*os.File, error)

func ResultsToServicesMap added in v0.5.0

func ResultsToServicesMap(res []types.ResultByTime) map[int]model.Service

func ReturnIfPresent

func ReturnIfPresent(s []string) string

func SortByFn

func SortByFn(sortByDate bool) string

func SortFunction added in v0.5.0

func SortFunction(sortBy string) func(r map[int]model.Service) []model.Service

func SortServicesByMetricAmount added in v0.5.0

func SortServicesByMetricAmount(r map[int]model.Service) []model.Service

func SortServicesByStartDate added in v0.5.0

func SortServicesByStartDate(r map[int]model.Service) []model.Service

func SplitCommaSeparatedString

func SplitCommaSeparatedString(value string) []string

func SplitNameValuePair

func SplitNameValuePair(value string) ([]string, error)

func SubtractDays

func SubtractDays(today time.Time, days int) string

func ToPrintWriterType

func ToPrintWriterType(s string) model.PrintWriterType

Types

This section is empty.

Jump to

Keyboard shortcuts

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