-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
31 lines (27 loc) · 727 Bytes
/
main.go
File metadata and controls
31 lines (27 loc) · 727 Bytes
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/RouteHub-Link/DomainUtils/config"
"github.com/RouteHub-Link/DomainUtils/handlers"
"github.com/RouteHub-Link/DomainUtils/tasks"
"github.com/RouteHub-Link/DomainUtils/validator"
)
var (
applicationConfig = config.GetApplicationConfig()
taskValidator = validator.DefaultValidator()
taskServer = tasks.NewDefaultTaskServer(
applicationConfig.TaskServerConfig,
applicationConfig.TaskConfigs,
taskValidator,
)
)
func main() {
switch applicationConfig.HostingMode {
case config.TaskReceiver:
es := handlers.NewEchoServer(applicationConfig, taskServer)
es.Serve()
case config.TaskServer:
taskServer.Serve()
case config.TaskMonitoring:
taskServer.AsynqmonServe()
}
}