utils

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 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

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

func ConvertServiceToSlice

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

func ConvertToFloat

func ConvertToFloat(amount string) float64

func ConvertToForecastStdoutType

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

func ConvertToPineconeStruct

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

func ConvertToStdoutType

func ConvertToStdoutType(s []types2.Service,
	granularity string) types2.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

func EncodeString(s string) string

func Format

func Format(date time.Time) string

func LastDayOfMonth

func LastDayOfMonth() string

func MaxSupportedRows

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

func MetricsToService

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

func NewFile

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

func ResultsToServicesMap

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

func ReturnIfPresent

func ReturnIfPresent(s []string) string

func SortByFn

func SortByFn(sortByDate bool) string

func SortFunction

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

func SortServicesByMetricAmount

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

func SortServicesByStartDate

func SortServicesByStartDate(r map[int]types2.Service) []types2.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) types2.PrintWriterType

Types

This section is empty.

Jump to

Keyboard shortcuts

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