-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
65 lines (52 loc) · 1.2 KB
/
main.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
package main
import (
"encoding/json"
"fmt"
"time"
mgo "gopkg.in/mgo.v2"
)
var (
config Configuration
mongoSession *mgo.Session
)
func main() {
var err error
config, err = ReadConfig()
if err != nil {
fmt.Println("Error reading config file")
return
}
// Connect to MongoDB
mongoSession, err = mgo.Dial(config.MongoDB)
if err != nil {
fmt.Println("Error connecting to database")
return
}
defer mongoSession.Close()
fmt.Printf("%s | ClanInspector started\r\n", time.Now().Format("2006-01-02 15:04:05"))
RetrieveMembers()
//RetrieveActivities()
//RetrievePlayersStats()
//RetrievePlayersAggregateStats()
//FixActivities()
//WhoPlaysWithWho(
// time.Date(2018, time.May, 12, 0, 0, 0, 0, time.UTC),
// time.Date(2019, time.June, 12, 0, 0, 0, 0, time.UTC),
// time.Now().Format("060102"),
// true,
//)
//WhoPlaysWhen(
// time.Date(2017, time.April,.y.yb,b, ,/, ,h,,/,, , r dt=0-]5 1, 0, 0, 0, 0, time.UTC),
// time.Date(2019, time.June, 1, 0, 0, 0, 0, time.UTC),
// time.Now().Format("060102"),
//)
//TestActivity("1676662159")
}
func StructToJSON(obj interface{}) string {
b, err := json.Marshal(obj)
if err != nil {
fmt.Println(err)
return ""
}
return string(b)
}