-
Notifications
You must be signed in to change notification settings - Fork 1
/
tables.go
70 lines (57 loc) · 1.99 KB
/
tables.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package main
import (
"fmt"
"strconv"
"time"
)
//draw table
func WriteTableStats(i int, field string, value interface{}) ([][]string, [][]string) {
y := strconv.Itoa(i)
valor := fmt.Sprintf("%v", value)
data := [][]string{
[]string{y, field, valor},
}
return data, nil
} //end func
//draw table
func WriteTableCountry(country string, code string, slug string) ([][]string, [][]string) {
//y := strconv.Itoa(i)
//valor := fmt.Sprintf("%v", value)
data := [][]string{
[]string{country, code, slug},
}
return data, nil
} //end func
//generic table
func GenericTableCountry(conf int, deaths int, recs int, act int, date time.Time) ([][]string, [][]string) {
//y := strconv.Itoa(i)
//valor := fmt.Sprintf("%v", value)
data := [][]string{
[]string{strconv.Itoa(conf), strconv.Itoa(deaths), strconv.Itoa(recs), strconv.Itoa(act), date.String()},
}
return data, nil
} //end func
func WriteTableAlldata(country string, code string, lat string, lon string, Confirmed int, Death int, Recover int, Active int, Date time.Time, Location string) ([][]string, [][]string) {
//y := strconv.Itoa(i)
//valor := fmt.Sprintf("%v", value)
data := [][]string{
[]string{country, code, lat, lon, strconv.Itoa(Confirmed), strconv.Itoa(Death), strconv.Itoa(Recover), strconv.Itoa(Active), Date.String(), Location},
}
return data, nil
} //end func
//draw table
func WriteTableCountries(country string, code string, slug string, confirmed int, totalConfirmed int, deaths int, totalDeaths int, recovered int, totalRecovered int) ([][]string, [][]string) {
//y := strconv.Itoa(i)
//valor := fmt.Sprintf("%v", value)
data := [][]string{
[]string{country, code, slug, strconv.Itoa(confirmed), strconv.Itoa(totalConfirmed), strconv.Itoa(deaths), strconv.Itoa(totalDeaths), strconv.Itoa(recovered), strconv.Itoa(totalRecovered)},
}
return data, nil
} //end func
//draw table
func WriteTableDate(Date time.Time) ([][]string, [][]string) {
data := [][]string{
[]string{Date.String()},
}
return data, nil
} //end func