新增对象存储/账单/保留IP模块,删桶并发提速与成本增强
CI / test (push) Successful in 33s

This commit is contained in:
2026-07-21 12:11:05 +08:00
parent 9cfde8b702
commit f40f2a20e8
44 changed files with 7788 additions and 54 deletions
+8 -2
View File
@@ -73,8 +73,11 @@ func applyCostDefaults(q *oci.CostQuery) {
func alignDown(t time.Time, granularity string) time.Time {
t = t.UTC()
if granularity == "MONTHLY" {
switch granularity {
case "MONTHLY":
return time.Date(t.Year(), t.Month(), 1, 0, 0, 0, 0, time.UTC)
case "HOURLY":
return t.Truncate(time.Hour)
}
return t.Truncate(24 * time.Hour)
}
@@ -84,8 +87,11 @@ func alignUp(t time.Time, granularity string) time.Time {
if down.Equal(t.UTC()) {
return down
}
if granularity == "MONTHLY" {
switch granularity {
case "MONTHLY":
return down.AddDate(0, 1, 0)
case "HOURLY":
return down.Add(time.Hour)
}
return down.AddDate(0, 0, 1)
}