Documentation
¶
Index ¶
- func AddDailyBilling(x, y data.DailyBilling) data.DailyBilling
- func AddDate(t time.Time, years, months, days int) time.Time
- func AddMonthlyBilling(x, y data.MonthlyBilling) data.MonthlyBilling
- func AddProductBilling(x, y data.ProductBilling) (data.ProductBilling, error)
- func CurrencyUnit(name string) (result string)
- func Date2Month(date string) string
- func Float64Add(a ...float64) float64
- func GetCurrentDirectory() (string, error)
- func IsValidDayDate(d string) bool
- func IsValidMonthDate(d string) bool
- func RatioString(s1, s2 string) string
- func ShowHtml(fPath string) error
- func SumByInstanceId(utilizations []data.InstanceCpuUtilization) int
- func Union(s1, s2 []string) []string
- type BillingDate
- type BillingDatePilot
- func (p *BillingDatePilot) ConvBillingDate2PreviousMonth(d BillingDate) BillingDate
- func (p *BillingDatePilot) ConvBillingDate2PreviousQuarter(d BillingDate) BillingDate
- func (p *BillingDatePilot) GetBillingDate(isRecentYear bool, firstMonths []int64) BillingDate
- func (p *BillingDatePilot) GetDaysInRecentMonth() []string
- func (p *BillingDatePilot) GetNowT() time.Time
- func (p *BillingDatePilot) GetPreviousDayBillingDate() BillingDate
- func (p *BillingDatePilot) GetPreviousMonth() string
- func (p *BillingDatePilot) GetPreviousYear(curYear ...string) string
- func (p *BillingDatePilot) GetPreviousYearBillingDate() BillingDate
- func (p *BillingDatePilot) GetRecentDayBillingDate() BillingDate
- func (p *BillingDatePilot) GetRecentMonth() string
- func (p *BillingDatePilot) GetRecentMonthBillingDate(isRecentYear bool) BillingDate
- func (p *BillingDatePilot) GetRecentQuarter() int
- func (p *BillingDatePilot) GetRecentQuarterBillingDate(isRecentYear bool) BillingDate
- func (p *BillingDatePilot) GetRecentXDaysBillingDate(x int32) BillingDate
- func (p *BillingDatePilot) GetRecentXMonthsBillingDate(x int32) BillingDate
- func (p *BillingDatePilot) GetRecentYear() int
- func (p *BillingDatePilot) GetRecentYearBillingDate() BillingDate
- func (p *BillingDatePilot) GetRecentYearMonths() []string
- func (p *BillingDatePilot) GetTargetYearData(data []string, offset int) []string
- func (p *BillingDatePilot) IsFirstDayOfYear() bool
- func (p *BillingDatePilot) SetNowT(t time.Time) *BillingDatePilot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDailyBilling ¶
func AddDailyBilling(x, y data.DailyBilling) data.DailyBilling
func AddMonthlyBilling ¶
func AddMonthlyBilling(x, y data.MonthlyBilling) data.MonthlyBilling
func AddProductBilling ¶
func AddProductBilling(x, y data.ProductBilling) (data.ProductBilling, error)
func CurrencyUnit ¶
func Float64Add ¶
func RatioString ¶
func SumByInstanceId ¶ added in v0.2.1
func SumByInstanceId(utilizations []data.InstanceCpuUtilization) int
Types ¶
type BillingDate ¶
type BillingDatePilot ¶
type BillingDatePilot struct {
// contains filtered or unexported fields
}
func NewBillDatePilot ¶
func NewBillDatePilot() *BillingDatePilot
func (*BillingDatePilot) ConvBillingDate2PreviousMonth ¶
func (p *BillingDatePilot) ConvBillingDate2PreviousMonth(d BillingDate) BillingDate
ConvBillingDate2PreviousMonth
func (*BillingDatePilot) ConvBillingDate2PreviousQuarter ¶
func (p *BillingDatePilot) ConvBillingDate2PreviousQuarter(d BillingDate) BillingDate
ConvDays2LastQuarter
func (*BillingDatePilot) GetBillingDate ¶
func (p *BillingDatePilot) GetBillingDate(isRecentYear bool, firstMonths []int64) BillingDate
GetBillingDate isCurrentYear: true 今年 | false 去年
func (*BillingDatePilot) GetDaysInRecentMonth ¶
func (p *BillingDatePilot) GetDaysInRecentMonth() []string
GetDaysInRecentMonth 获取截至今天的当前月份的日期 [2022-10-01, 2022-10-02, ..., 2022-10-07]
func (*BillingDatePilot) GetNowT ¶
func (p *BillingDatePilot) GetNowT() time.Time
func (*BillingDatePilot) GetPreviousDayBillingDate ¶
func (p *BillingDatePilot) GetPreviousDayBillingDate() BillingDate
GetPreviousDayBillingDate
func (*BillingDatePilot) GetPreviousMonth ¶
func (p *BillingDatePilot) GetPreviousMonth() string
GetPreviousMonth
func (*BillingDatePilot) GetPreviousYear ¶
func (p *BillingDatePilot) GetPreviousYear(curYear ...string) string
GetPreviousYear
func (*BillingDatePilot) GetPreviousYearBillingDate ¶
func (p *BillingDatePilot) GetPreviousYearBillingDate() BillingDate
GetPreviousYearBillingDate
func (*BillingDatePilot) GetRecentDayBillingDate ¶
func (p *BillingDatePilot) GetRecentDayBillingDate() BillingDate
GetRecentDayBillingDate
func (*BillingDatePilot) GetRecentMonth ¶
func (p *BillingDatePilot) GetRecentMonth() string
GetRecentMonth
func (*BillingDatePilot) GetRecentMonthBillingDate ¶
func (p *BillingDatePilot) GetRecentMonthBillingDate(isRecentYear bool) BillingDate
GetRecentMonthBillingDate
func (*BillingDatePilot) GetRecentQuarter ¶
func (p *BillingDatePilot) GetRecentQuarter() int
GetRecentQuarter
func (*BillingDatePilot) GetRecentQuarterBillingDate ¶
func (p *BillingDatePilot) GetRecentQuarterBillingDate(isRecentYear bool) BillingDate
GetRecentQuarterBillingDate
func (*BillingDatePilot) GetRecentXDaysBillingDate ¶
func (p *BillingDatePilot) GetRecentXDaysBillingDate(x int32) BillingDate
GetRecentXDaysBillingDate 返回过去 X 天(不含今天)的日期 ["2022-09-24","2022-09-25", ... "2022-10-07"]
func (*BillingDatePilot) GetRecentXMonthsBillingDate ¶
func (p *BillingDatePilot) GetRecentXMonthsBillingDate(x int32) BillingDate
GetRecentXMonthsBillingDate 返回过去 x 个月(不含 1 号当月) ["2021-11","2021-12", ... "2022-09",]
func (*BillingDatePilot) GetRecentYear ¶
func (p *BillingDatePilot) GetRecentYear() int
GetRecentYear
func (*BillingDatePilot) GetRecentYearBillingDate ¶
func (p *BillingDatePilot) GetRecentYearBillingDate() BillingDate
GetRecentYearBillingDate
func (*BillingDatePilot) GetRecentYearMonths ¶
func (p *BillingDatePilot) GetRecentYearMonths() []string
GetYearMonths 获取今年截至今天的所有月份 [2022-01,2022-02, ..., 2022-10]
func (*BillingDatePilot) GetTargetYearData ¶
func (p *BillingDatePilot) GetTargetYearData(data []string, offset int) []string
GetTargetYearData 获取目标年的年/月/日数据 offset : negative value for the year before ,vice versa
func (*BillingDatePilot) IsFirstDayOfYear ¶
func (p *BillingDatePilot) IsFirstDayOfYear() bool
IsFirstDayOfYear
func (*BillingDatePilot) SetNowT ¶
func (p *BillingDatePilot) SetNowT(t time.Time) *BillingDatePilot