forked from redhat-best-practices-for-k8s/collector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
26 lines (21 loc) · 686 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
package main
import (
"time"
_ "github.com/go-sql-driver/mysql"
"github.com/sirupsen/logrus"
"github.com/test-network-function/collector/api"
"github.com/test-network-function/collector/storage"
"github.com/test-network-function/collector/util"
)
func main() {
readTimeOut, writeTimeOut, addr, envErr := util.GetServerEnvVars()
if envErr != "" {
logrus.Errorf(util.ServerEnvVarsError, envErr)
}
s3Store := storage.NewS3Storage()
mysqlStore := storage.NewMySQLStorage()
defer mysqlStore.MySQL.Close()
server := api.NewServer(addr, mysqlStore, s3Store,
time.Duration(readTimeOut)*time.Second, time.Duration(writeTimeOut)*time.Second)
logrus.Fatal(server.Start())
}