-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathmain.go
50 lines (44 loc) · 1.02 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
package main
import (
_ "GoChatCraft/docs"
"GoChatCraft/global"
"GoChatCraft/initialize"
"GoChatCraft/models"
router "GoChatCraft/router"
"fmt"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
)
// @title 接囗文档
// @version 1.0
// @description ChatCraft
// @termsofservice https://github.com/taxze6
// @contact.name Taxze
// @contact.email [email protected]
// @host 127.0.0.1:8889
func main() {
//Initialize logging.
initialize.InitLogger()
fmt.Println(global.ServiceConfig.Port)
//Initialize database.
initialize.InitDB()
//Initialize redis.
initialize.InitRedis()
r := router.Router()
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
err := r.Run(fmt.Sprintf(":%d", global.ServiceConfig.Port))
if err != nil {
return
}
}
func init() {
//Initialize the configuration.
initialize.InitConfig()
//UDP
//go UdpSendProc()
//go UdpRecProc()
//rabbitMQ
models.RabbitmqCreateExchange()
go models.RabbitmqRecProc()
go models.RabbitmqSendProc()
}