-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.go
40 lines (31 loc) · 871 Bytes
/
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
package main
import (
"io/ioutil"
"net/http"
"github.com/TF2Stadium/Pauling/config"
"github.com/TF2Stadium/Pauling/database"
"github.com/TF2Stadium/Pauling/helpers"
"github.com/TF2Stadium/Pauling/rpc"
"github.com/TF2Stadium/Pauling/server"
_ "github.com/rakyll/gom/http"
)
func getlocalip() string {
resp, err := http.Get("http://api.ipify.org")
if err != nil {
helpers.Logger.Fatal(err)
}
bytes, _ := ioutil.ReadAll(resp.Body)
return string(bytes)
}
func main() {
config.InitConstants()
helpers.InitLogger()
if config.Constants.ProfilerAddr != "" {
helpers.Logger.Info("Running profiler on %s", config.Constants.ProfilerAddr)
go func() { helpers.Logger.Errorf("%v", http.ListenAndServe(config.Constants.ProfilerAddr, nil)) }()
}
database.Connect()
server.StartListener()
server.CreateDB()
rpc.StartRPC(config.Constants.RabbitMQURL)
}