-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
30 lines (23 loc) · 737 Bytes
/
main.go
File metadata and controls
30 lines (23 loc) · 737 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
package main
import (
"context"
"fmt"
"github.com/tclemos/go-web-service-example/adapters/http"
"github.com/tclemos/go-web-service-example/adapters/http/controllers"
"github.com/tclemos/go-web-service-example/adapters/postgres"
"github.com/tclemos/go-web-service-example/adapters/sqs"
"github.com/tclemos/go-web-service-example/core/services"
)
func main() {
ctx := context.Background()
querier, err := postgres.NewQuerier(ctx)
if err != nil {
panic(fmt.Sprintf("Failed to connect to postgres, err: %v", err))
}
tr := postgres.NewThingRepository(querier)
tn := sqs.NewThingNotifier()
ts := services.NewThingService(tr, tn)
tc := controllers.NewThingsController(ts)
server := http.NewServer(tc)
server.Start()
}