/
main.go
47 lines (38 loc) · 1.06 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
package main
import (
"flag"
log "github.com/sirupsen/logrus"
"github.com/vinothsparrow/scanner/config"
"github.com/vinothsparrow/scanner/helper"
"github.com/vinothsparrow/scanner/server"
_ "github.com/vinothsparrow/scanner/tests"
)
// @title .git folder scanner API
// @version 1.0
// @description This is a scanner server to scan .git folder in the website.
// @host
// @BasePath /
// @securityDefinitions.apikey ApiKeyAuth
// @in query
// @name api_key
// @contact.name API Support
// @contact.url https://github.com/vinothsparrow/scanner
// @contact.email vinothsparrow@live.com
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @termsOfService http://swagger.io/terms/
func main() {
environment := flag.String("e", "development", "")
log.SetFormatter(&log.TextFormatter{
DisableColors: true,
FullTimestamp: true,
})
flag.Usage = func() {
log.Fatal("Usage: server -e {mode}")
}
flag.Parse()
config.Init(*environment)
c := config.GetConfig()
helper.StartDispatcher(c.GetInt("worker.count"))
server.Init()
}