-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
46 lines (37 loc) · 1.05 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
package main
import (
"flag"
"fmt"
"permission-open/internal"
"permission-open/internal/app/router"
"permission-open/internal/pkg/conf"
"github.com/gin-gonic/gin"
)
var readConfMode int
var configFile string
func main() {
flag.IntVar(&readConfMode, "m", 0, "读取环境变量还是读取配置文件")
flag.StringVar(&configFile, "c", "./configs/dev.yaml", "app config file.")
flag.Parse()
internal.InitProjects(readConfMode, configFile)
//pyroscope.Start(
// pyroscope.Config{
// ApplicationName: "RunnerGo-permission-open",
// ServerAddress: "http://192.168.1.205:4040/",
// Logger: pyroscope.StandardLogger,
// ProfileTypes: []pyroscope.ProfileType{
// pyroscope.ProfileCPU,
// pyroscope.ProfileAllocObjects,
// pyroscope.ProfileAllocSpace,
// pyroscope.ProfileInuseObjects,
// pyroscope.ProfileInuseSpace,
// },
// })
r := gin.New()
router.RegisterRouter(r)
// 全局参数企业相关信息
internal.InitSomething()
if err := r.Run(fmt.Sprintf(":%d", conf.Conf.Http.Port)); err != nil {
panic(err)
}
}