-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.go
More file actions
41 lines (34 loc) · 915 Bytes
/
main.go
File metadata and controls
41 lines (34 loc) · 915 Bytes
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
package main
import (
"fmt"
_ "net/http/pprof"
"github.com/Preloading/TwitterAPIBridge/config"
"github.com/Preloading/TwitterAPIBridge/db_controller"
"github.com/Preloading/TwitterAPIBridge/notifications"
"github.com/Preloading/TwitterAPIBridge/twitterv1"
)
var (
configData *config.Config
)
func main() {
// Enable pprof for debugging purposes
// go func() {
// log.Println(http.ListenAndServe("localhost:6060", nil))
// }()
var err error
configData, err = config.LoadConfig()
if err != nil {
fmt.Printf("Error loading config: %v\n", err)
return
}
if configData.SecretKey == "" {
fmt.Println("The JWT Secret key must be set in config.yaml.")
return
} else if len(configData.SecretKey) < 32 {
fmt.Println("The JWT Secret key must be 32 bytes long")
return
}
db_controller.InitDB(*configData)
go notifications.RunNotifications(*configData)
twitterv1.InitServer(configData)
}