forked from coaidev/coai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformat.go
46 lines (36 loc) · 865 Bytes
/
format.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package admin
import (
"fmt"
"time"
)
func getMonth() string {
date := time.Now()
return date.Format("2006-01")
}
func getDay() string {
date := time.Now()
return date.Format("2006-01-02")
}
func getDays(n int) []time.Time {
current := time.Now()
var days []time.Time
for i := n; i > 0; i-- {
days = append(days, current.AddDate(0, 0, -i+1))
}
return days
}
func getErrorFormat(t string) string {
return fmt.Sprintf("nio:err-analysis-%s", t)
}
func getBillingFormat(t string) string {
return fmt.Sprintf("nio:billing-analysis-%s", t)
}
func getMonthBillingFormat(t string) string {
return fmt.Sprintf("nio:billing-analysis-%s", t)
}
func getRequestFormat(t string) string {
return fmt.Sprintf("nio:request-analysis-%s", t)
}
func getModelFormat(t string, model string) string {
return fmt.Sprintf("nio:model-analysis-%s-%s", model, t)
}