MCPcopy
hub / github.com/awake1t/linglong / setupSetting

Function setupSetting

main.go:65–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63}
64
65func setupSetting() error {
66 s, err := setting.NewSetting(strings.Split("configs/", ",")...)
67 if err != nil {
68 return err
69 }
70 err = s.ReadSection("Server", &global.ServerSetting)
71 if err != nil {
72 return err
73 }
74 err = s.ReadSection("App", &global.AppSetting)
75 if err != nil {
76 return err
77 }
78 err = s.ReadSection("Database", &global.DatabaseSetting)
79 if err != nil {
80 return err
81 }
82 err = s.ReadSection("Masscan", &global.MasscanSetting)
83 if err != nil {
84 return err
85 }
86 global.AppSetting.DefaultContextTimeout *= time.Second
87 //global.JWTSetting.Expire *= time.Second
88 global.ServerSetting.ReadTimeout *= time.Second
89 global.ServerSetting.WriteTimeout *= time.Second
90
91 models.Setup()
92
93 return nil
94}

Callers 1

initFunction · 0.85

Calls 3

ReadSectionMethod · 0.95
NewSettingFunction · 0.92
SetupFunction · 0.92

Tested by

no test coverage detected