forked from guoxiaopeng875/matching-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
31 lines (28 loc) · 809 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
package main
import (
"github.com/gin-gonic/gin"
"github.com/guoxiaopeng875/matching-engine/config"
"github.com/guoxiaopeng875/matching-engine/engine"
"github.com/guoxiaopeng875/matching-engine/errcode"
"github.com/guoxiaopeng875/matching-engine/handler"
"github.com/guoxiaopeng875/matching-engine/log"
"github.com/guoxiaopeng875/matching-engine/middleware"
"github.com/guoxiaopeng875/matching-engine/process"
)
func init() {
config.Init(config.TestPath)
log.Init()
errcode.Init(config.Conf.ErrCodes)
engine.Init()
middleware.Init()
process.Init()
}
func main() {
e := gin.Default()
e.POST("/open_matching", handler.OpenMatching())
e.POST("/close_matching", handler.CloseMatching())
e.POST("/handle_order", handler.HandleOrder())
if err := e.Run(":8989"); err != nil {
panic(err)
}
}