-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
31 lines (24 loc) · 906 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 (
"log"
booking_setup "github.com/antosdaniel/go-presentation-collaborating-on-architecture/module/booking/setup"
notification_setup "github.com/antosdaniel/go-presentation-collaborating-on-architecture/module/notification/setup"
"github.com/antosdaniel/go-presentation-collaborating-on-architecture/pkg/metrics"
"github.com/antosdaniel/go-presentation-collaborating-on-architecture/pkg/setup"
)
func main() {
s := setup.New()
notification, err := notification_setup.NewSetup()
if err != nil {
log.Fatalf("Could not set up no module: %v", err)
}
booking, err := booking_setup.New(s.Enqueueer, notification.API)
if err != nil {
log.Fatalf("Could not set up booking module: %v", err)
}
go booking.ListenForEvents(s.Dequeueer)
go notification.PeriodicRetry()
metrics.RegisterRoutes(s.Router)
booking.RegisterRoutes(s.Router.Group("/booking"))
s.StartServer()
}