-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
25 lines (20 loc) · 841 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
package main
import (
"context"
"github.com/PacktPublishing/Hands-On-Dependency-Injection-in-Go/ch06/acme/internal/config"
"github.com/PacktPublishing/Hands-On-Dependency-Injection-in-Go/ch06/acme/internal/modules/get"
"github.com/PacktPublishing/Hands-On-Dependency-Injection-in-Go/ch06/acme/internal/modules/list"
"github.com/PacktPublishing/Hands-On-Dependency-Injection-in-Go/ch06/acme/internal/modules/register"
"github.com/PacktPublishing/Hands-On-Dependency-Injection-in-Go/ch06/acme/internal/rest"
)
func main() {
// bind stop channel to context
ctx := context.Background()
// build model layer
getModel := &get.Getter{}
listModel := &list.Lister{}
registerModel := ®ister.Registerer{}
// start REST server
server := rest.New(config.App.Address, getModel, listModel, registerModel)
server.Listen(ctx.Done())
}