-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathmain.go
40 lines (33 loc) · 923 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
32
33
34
35
36
37
38
39
40
package main
import (
"github.com/qinguoyi/osproxy/api"
"github.com/qinguoyi/osproxy/app"
"github.com/qinguoyi/osproxy/app/pkg/base"
"github.com/qinguoyi/osproxy/app/pkg/storage"
"github.com/qinguoyi/osproxy/bootstrap"
"github.com/qinguoyi/osproxy/bootstrap/plugins"
)
// @title ObjectStorageProxy
// @version 1.0
// @description
// @contact.name qinguoyi
// @host 127.0.0.1:8888
// @BasePath /
func main() {
// config log
lgConfig := bootstrap.NewConfig("conf/config.yaml")
lgLogger := bootstrap.NewLogger()
// plugins DB Redis Minio
plugins.NewPlugins()
defer plugins.ClosePlugins()
// init Snowflake
base.InitSnowFlake()
// init storage
storage.InitStorage(lgConfig)
// router
engine := api.NewRouter(lgConfig, lgLogger)
server := app.NewHttpServer(lgConfig, engine)
// app run-server
application := app.NewApp(lgConfig, lgLogger.Logger, server)
application.RunServer()
}